Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Tomi |
Hello!
I would like create a node around an other, rotatable node. I know the direction and distance (e.g.: 50 pixels) and I would like the XY coordinates on basis of these.
This is the piece of code in player1 node:
player2.position.x=position.x+50*cos(rotation_degrees)
player2.position.y=position.y+50*sin(rotation_degrees)
I have similar problem like this:
https://forum.godotengine.org/50695/rotate-object-around-origin
but I can’t set the center of rotation to player1 positions. So, the player2 always orbits around itself but I would like similar a bullet creating at the cannon barrel or a planet around a star.