why collision shape doesn't rotate?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By abismol

I would like to ask if it’s possible to make collision shape rotate with sprite? Because when I run it the way i tought might work, the sprite is rotating, but the collision shapes doesn’t rotate with it.

Collision shapes will rotate along with the parent body. You didn’t say how you tried to do it, so it’s hard to tell you what you did wrong.

kidscancode | 2018-02-15 22:03

I just wrote rotate(0.03) in Node2D which is the parent of RigidBody2D, Sprite, and Collisions. So I should make the RigidBody2D to rotate, so that Collisions would rotate with it?

abismol | 2018-02-16 09:51

Looks like it is working fine for me. Here is a demo.


The demo should look like below. The collision shapes can be seen rotating around the sprite.

enter image description here

Beamer159 | 2018-02-16 14:11

:bust_in_silhouette: Reply From: koigx

My advice is that you should attach the script that dictates rotation to the rigidbody that is the parent of the collision shapes.

1 Like