|
Post by DarkTonic Dev on Mar 16, 2018 22:15:28 GMT
Of course.
|
|
|
Post by illustrator on Aug 3, 2019 3:32:47 GMT
How about adding "step" fields to all of the "Randomization" settings? For example if I'd like the Y rotation be randomized between 0 and 360 with 5 degree steps.
|
|
|
Post by DarkTonic Dev on Aug 3, 2019 4:47:50 GMT
How about adding "step" fields to all of the "Randomization" settings? For example if I'd like the Y rotation be randomized between 0 and 360 with 5 degree steps. You can do that already with the Incremental Settings instead of Randomization.
|
|
|
Post by illustrator on Aug 3, 2019 9:36:44 GMT
Like this? Maybe I'm overlooking something but if I use incremental settings spawned objects are positioned evenly instead of randomization?
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Aug 3, 2019 14:02:02 GMT
Like this? Maybe I'm overlooking something but if I use incremental settings spawned objects are positioned evenly instead of randomization?
The only value you have set is the Y rotation. That won't change spacing. Change the X or Y values.
|
|
|
Post by illustrator on Aug 3, 2019 14:37:27 GMT
Umm.. I fail to undestand how to achieve that. If I also change X or Y it start to go like this:
Maybe I should clarify this a little bit.What I'd like to achieve is to have objects placed randomly on a circle but with a defined step. Now if I need random rotation around Y axis (or any axis) objects are sometimes overlapping, at least they do when I look at the wave visualization.
In other words I'd like to have a set of random numbers with a defined step, let's say 5 degrees, that would for example produce random numbers 5,25,60,65, 120, 155.. and so on.
360/5 = 72
So there are 72 random places available for objects to spawn in this example, each at minimum 5 degrees apart.
Is this already possible using some settings? If it is it would really help to see a screenshot.
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Aug 3, 2019 14:42:18 GMT
Umm.. I fail to undestand how to achieve that. If I also change X or Y it start to go like this:
Maybe I should clarify this a little bit.What I'd like to achieve is to have objects placed randomly on a circle but with a defined step. Now if I need random rotation around Y axis (or any axis) objects are sometimes overlapping, at least they do when I look at the wave visualization.
In other words I'd like to have a set of random numbers with a defined step, let's say 5 degrees, that would for example produce random numbers 5,25,60,65, 120, 155.. and so on.
360/5 = 72
So there are 72 random places available for objects to spawn in this example, each at minimum 5 degrees apart.
Is this already possible using some settings? If it is it would really help to see a screenshot.
As far as I know there is no such setting to place objects randomly on a circle. I don't see how you would have inferred that from the incremental settings provided. Rotation is simply 360 rotation in-place.
|
|
|
Post by illustrator on Aug 3, 2019 14:53:57 GMT
It is possible to place objects on a circle, like this:
But because there's no setting to define the step objects sometimes seem to overlap:
|
|
magique
Full Member
 
Posts: 194
Posts: 194
|
Post by magique on Aug 3, 2019 14:57:23 GMT
Well, I didn't know that. I guess you'll have to wait for DarkTonic to respond and see if there is a better way to achieve what you re trying.
|
|
|
Post by DarkTonic Dev on Aug 3, 2019 16:37:09 GMT
Yeah you can do circles. With Incrementation rotation, and the radius of the circle is set by "Post-Spawn Nudge", as shown above. Correct, there's no "limited / restricted random". Random means random, period. I suppose you could not use random, and spawn the entire circle, then randomly despawn some percent of them? That would achieve the same result. As far as the random despawn, I don't think there's a CGK script that does that for you.
It it would basically have code like this:
public int PercentToDespawn = 50; // you can modify in Inspector.
void OnSpawned() { var rand = Random.Range(0, 100); if (rand < PercentToDespawn) { PoolBoss.Despawn(this.Transform); } }
I can include that script in the next update if you think it's useful.
|
|
|
Post by illustrator on Aug 3, 2019 18:49:04 GMT
Okay, go ahead and include it. I'll try it.
|
|
|
Post by DarkTonic Dev on Aug 4, 2019 3:41:58 GMT
First let's make sure that it's useful and works before I include it. Report back that it's good (or not) and I will do so.
|
|
|
Post by illustrator on Aug 5, 2019 5:44:35 GMT
I use Core GameKit with Playmaker and I found a way to do the same thing with a simple Playmaker FSM so we can forget this.
|
|
|
Post by DarkTonic Dev on Aug 5, 2019 15:20:03 GMT
Alright thank you.
|
|
|
Post by illustrator on Aug 11, 2019 10:45:17 GMT
Correct, there's no "limited / restricted random". Random means random, period. Yes I agree but I still think that it would improve the product by giving more control.
Another thing, would it make any sense to have optional collision check when spawning so that prefabs would not overlap each other? If it collides then it tries another position?
|
|