#set rotation of a object (RigidBody3D and/or KineticBody3D)
13 messages · Page 1 of 1 (latest)
i pretty much use this:
<yourRigidBody3D>.rotation_degrees.x = <value>
<yourRigidBody3D>.rotation_degrees.y = <value>
<yourRigidBody3D>.rotation_degrees.z = <value>
yeah, but I was looking more for a one line function, for all 3 values
but thanks
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
true
rotation_degrees= Vector3(x,y,z)
or that xd
its much better and you can use it anywhere so yea O_>O
also be aware that you should use _integrate_forces() to change the rotation of a rigidbody or it will probably not work (as expected), unless you are just doing it when instancing it i guess
it works already with rotation_degrees= Vector() on a RigidBody
may mess with the physics simulation/collision detection etc if you are doing it while its active outside of integrate_forces