Godot 4.4
Greetings! I have a shield that is made up of a characterbody3d, a mesh instance (temporary), and a collision shape. How do I code it so that it always sits in front of where the player is facing?
Godot 4.4
Greetings! I have a shield that is made up of a characterbody3d, a mesh instance (temporary), and a collision shape. How do I code it so that it always sits in front of where the player is facing?
Add it as a child, or if you have a skelaton there’s an attachment point node you can use.
Thanks for answering! Unfortunately, that didn’t work for me, and I don’t have a skeleton for the model, but I have found out that the solution was to input this code into my physics process.
if input_dir != Vector2(0, 0):
$shield.rotation_degrees.y = $Camera_Controller.rotation_degrees.y - rad_to_deg(input_dir.angle())