@DaveTheCoder said: Here's some code I'm using for a RigidBody2D.
speed and dir are floats. dir is the direction in radians, in the range -PI to PI, measured clockwise from the positive X-axis. linear_velocity is a Vector2 property of a RigidBody2D.
# Set velocity (speed and direction). # First set the velocity vector along the positive X-axis, using the specified speed. # Then rotate the velocity vector to the specified direction. linear_velocity = Vector2(speed, 0.0).rotated(dir)
I am trying to use the rotated() function in 3D, and it says to put an axis for argument 1, how would I signify I want to use the Y axis? The documentation doesn't really say.