How to make an arrest system

Godot Version

Godot-4

Question

Does anyone know how to make an arrest button pop up when in range of a character/NPC? I want the UI to be like click E to Arrest so like [ E Arrest].

Edit:
Thanks for all the replies, but I think I’ll get more experienced first and then come back to this.

You can use an Area3D to detect the player nearby.

6 Likes

Thanks for your answer, but I want some experienced people to respond as I am new to godot and looking for more detailed answers.

Post your npc and player inplementation code and scene structures.

I am experienced. I just responded with about as much effort as you put in your own post asking for help.

Besides, there are an infinite number of ways to achieve what you want. Without seeing what code you wrote so far, it’s a bit like trying to read your mind and guess what the best solution should be.

2 Likes

I hope you don’t expect someone make you complete tutorial .

Usually is good idea post code along with your scene tree and what type of UI you think to use .

Also there is quite few tutorials for 2d and 3d , Dialogue could be plugin you looking for to make your life easier if you plan more interactions between npc and player .

1 Like

Small advice for the future: You don’t want to know how to make an “arrest system” but instead…

Does anyone know how to make an arrest button pop up when in range of a character/NPC?

…this. Try to break down your problem/question as much as possible because no one here can answer how to make an arrest system for your special case but people can give you hints on how to approach the “show something when in range of an NPC” problem.

3 Likes

Well, maybe they do want to know how to make the whole system, including putting handcuffs on the npc and escorting them to the jail. We’ll likely never know :rofl:

True, it’s possible. :laughing:

AI, write me an arrest system!

No thanks :laughing:

This guy is one of the few people I could find who is currently active and has been on the forum as me and was called inexperienced. The answer he gave is completely fair and exactly how I would do it. Are you new to code entirely and expect people on the forum to just write code for you or explain what every node is. You have to research yourself.

I was serious.