#set rotation of a object (RigidBody3D and/or KineticBody3D)

13 messages · Page 1 of 1 (latest)

foggy hazel
#

Hey, is there a function to set the x, y, and z rotation of a RigidBody3D?

devout tapir
#

i pretty much use this:

<yourRigidBody3D>.rotation_degrees.x = <value>
<yourRigidBody3D>.rotation_degrees.y = <value>
<yourRigidBody3D>.rotation_degrees.z = <value>

foggy hazel
#

but thanks

devout tapir
#

u could make one instead

#

func set_rotation(target, valX, valY, valZ)
target.rotation_degrees.x = valX
target.rotation_degrees.y = valY
target.rotation_degrees.z = valZ

foggy hazel
#

true

drowsy anchor
#

rotation_degrees= Vector3(x,y,z)

devout tapir
#

its much better and you can use it anywhere so yea O_>O

drowsy anchor
foggy hazel
#

it works already with rotation_degrees= Vector() on a RigidBody

drowsy anchor
#

may mess with the physics simulation/collision detection etc if you are doing it while its active outside of integrate_forces