- Home /
Question by
eni_cay · Feb 20, 2020 at 07:01 PM ·
rigidbody2dshooting2d-physics2d spriteskinematic
Spin a non-kinematic 2d object ?
i have a 2d object that spins when the player holds it (kinematic is set to true) , but when the player shoots the object (kinematic is set to false) but when its shot , it stops spinning , how do i keep it spinning even in non kinematic state ? the game is similar to angry birds void Update() { rb.MoveRotation(rb.rotation + revSpeed * Time.fixedDeltaTime); }
void OnMouseDown()
{
IsPressed = true;
rb.isKinematic = true;
}
void OnMouseUp()
{
rb.MoveRotation(rb.rotation + revSpeed * Time.fixedDeltaTime);
IsPressed = false;
rb.isKinematic = false ;
StartCoroutine(Release());
}
Comment
Your answer
Follow this Question
Related Questions
2D Sprite drifting down, otherwise passes through walls - how do I fix these issues? 0 Answers
Freeze rotation but needs angular rotate token in Rigidbody 2D 0 Answers
Switching from kinematic to dynamic without stutter 0 Answers
How to stop Players pushing Enemies 1 Answer
How do I collide a Kinematic sprite ? 0 Answers