unity3d - Separate RigidBod2D rotation from Sprite -
using unity 2d allow use rigidbody2d, want prevent sprite rotating when rigidbody rotates. how can this?
in other words, want simulation fine, not want graphics object rotate.
use 2 gameobjects: parent gameobject containing rigidbody2d component, , child gameobject containing spriterenderer component.
then attach script child gameobject assigns transform.rotation whatever you'd like:
var desiredrotation:quaternion; function lateupdate () { transform.rotation = desiredrotation; } this allows sprite maintain rotation continously, no matter how rigidbody rotated.
Comments
Post a Comment