KinematicBody2D as child of KinematicBody2D

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

HI, I have been working on the KidsCanCode top down tank tutorial and am experimenting with building tanks differently. what I am trying to do is to make one scene that handles vehicles , and one that handles turrets, because not all vehicles have turrets or the same turret so I was trying to make a turret as a scene that can be instanced on to vehicles that have turrets.

I have a tank body on the vehicle scene and by itself I can move it, I am using a click to move. but if I instance the turret onto the body it changes the action of the body. the body makes it to the click position but it no longer drives there , it doesn’t seem able to rotate and bounces up and down a lot.

what I think might be happening is the call to move_and_slide is trying to act on both Kinematic bodies.

I am not sure how I am looking at it wrong , my idea was to make the turret a kinematic body so that the turret would also have collision so the Muzzle couldn’t just pass through other objects like walls and I thought from the documentation a kinematicbody was the right choice because I want to directly move/rotate it.

perhaps there is just something simple that I don’t have the experience to know?

:bust_in_silhouette: Reply From: ArthurER

I figured out what was going on was the turret was just colliding with the vehicle body, I set the layers up and it works now. leads me to another question but I should probably ask that as a different question…