0 votes

Basically, I am working on a maze generator and right now I am using draw_texture() to draw a wall at a specific location. However, later on I want to add collisions and physics so I may need a more sophisticated way of drawing walls. I am quite new to godot so are there any nodes or so that I would have to setup or so?

in Engine by (20 points)

1 Answer

0 votes

Instead of drawing a texture use the physics bodies: StaticBody2D, KinematicBody2D and RigidBody2D. You can add collision shapes and sprites with the CollisionShape node (and CollisionPolygon2D) and Sprite node respectively to this nodes. This physics bodies will allow you to implement objects that collide but don't move (Static), objects that move the way you want (Kinematic) and objects that follow the laws of physics (Rigid). You can find all the info you need in the docs.

by (685 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.

Categories