I’m working on a 2D project and using RigidBody2D for bullets. I would like to add a texture to the RigidBody2D to represent the bullet visually, but I’m unsure how to properly attach a Sprite2D or another node to display the texture.
Here’s what I’ve tried so far:
I’ve added a Sprite2D as a child of the RigidBody2D.
I made sure the texture is set for the Sprite2D.
In my script, I used get_node_or_null(“Sprite2D”) to access the sprite and set its visibility, but the texture is not showing during gameplay.
Am I missing something in the setup or script? Is there a better way to handle adding textures to a RigidBody2D in Godot?