godot_recipes
godot_recipes copied to clipboard
[Discussion] Basics: Circular Movement
Discussion for http://godotrecipes.com/basics/rotation/
For the 2D version, how would you make the godot icon stay vertical while rotating? And how would you add a CollisionShape2D to it? (mine stays centered and doesn't inherit the offset)
If you didn't want the sprite to rotate, you could negate the rotation it's getting from its parent:
func _process(delta):
$Sprite/Pivot.rotation += rotation_speed * delta
$Sprite/Pivot/Sprite2.global_rotation = 0
I'm not sure what you mean by "adding a CollisionShape to it". What are you adding a collision shape to - there are no collision objects in this demo...
Thank you :) This does work.
As for the CollisionShape2D, I just wanted to add it to the sprite so that a vehicle could collide with the sprite and gain some powerup or whatnot.
I got it working like so.
I personally think you should remove the first sprite and get the minimal working example. I was confused for a while as to what exactly the pivot was doing (eg. should it also be offset?)
I'm working on a space game and trying to make an elliptical orbit.
Would I be able to use this method somehow with two pivot points, one nested on another (something like the pic below) or would I have to take a different approach to this?
If I can use this, what might the code look like for it?
Hello, I am new to GitHub, but I need help in creating an 2D air ring with x-z axial revolution by using Particles2D. Can someone help me?