I want to make a spike ball rotate around a block, how do I achieve this?
I tried putting the object around the other but how do I make it so that it keeps rotating infinetely?
The easiest way is to change the angle of your rotating sprite (increase it every frame, for example), and setting the rotation around the object to the angle of the rotating sprite:
Alternatively you can use a variable and update it every frame.
or “change the angle of object: add 10”
If the angle reaches 360, does it switch over to 10 or go on to 370 and up?
Because if it does, isn’t there a limit on how big a float or integer can be?
Because if the player for example, plays the game on their phone and leaves the phone on for a long time, could that specific action stop or crash.
Im just curious.
Fair call, and a valid point, though once the limit is reached it would won’t crash, it’d cause an overflow. And the angle would start a very large negative value (see this NumberPhile explanation)
However, it would take quite a while to get there. But to prevent this, use the modulo operator/function, and set the rotate around angle to mod(OrbitingObject.Angle() + 10, 360)
Ok cool. Thanks.
Now I know😁
I think there’s some sort of automatic reset, if the angle is more than x, it subtracts 360.
Why not try yourself and see? Display it in a text object and find out.
Yes, will do. For now Im just trying to figure out the best way to load and unload chunk’s in a randomly generated world