0 votes

Noob question (college freshman programmer)

May I ask how do you make an enemy detect the player using RayCast2D?

The NPC I made is just walking endlessly unless it hits a wall/object/KinematicBody2D) or it's on an edge, then it will go the other way. And I don't want it to go the other way if it hits a KinematicBody2D..

I am not well-versed in Godot Scripts, so it would help me a lot in this project (a group project required to pass this course) if someone can share their knowledge with me.

Thanks!

I'm using C# with this Godot

Godot version Godot v3.4.4-stable_mono
in Engine by (12 points)

Please log in or register to answer this question.

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.