#Circling around an object movement

3 messages · Page 1 of 1 (latest)

mortal barn
#

I'm trying to create a movement system similar to that of Bopl Battle where the player can stick to a platform and circle around, so it can go on the side and upside down and loop around.

In my game there is just one platform and I don't need jumping, the player just needs to be able to circle around it, the platform is a rectangle with rounded edges.

heavy delta
# mortal barn I'm trying to create a movement system similar to that of Bopl Battle where the ...

you could just put an empty transform in the center of the planet, then put the player as child transform onto that transform (player.transform.parent = thatTransform)

then you can simply rotate the center transform and the character will rotate with it

for a more math based situation you could do this
planetCenterPosition + Quaternion.Euler(0f, 0f, yourDesiredRotationInDegrees) * (Vector3.up * centerToCharacterDistance);

#

there is a version of this for 2d too but this works for 2d and 3d space
so you take the center and add to it an up vector of a certain distance, and that vector is rotated by your desired rotation