NPC bug
#1

Is there any way for NPCs to detect a building? I'm having this bug wherein if I'm being chased by NPCs and I'm below a building/any place I'm covered by a building, it teleports the NPC to the top of the building. Can this be avoided?

Preview of bug:

*******
Reply
#2

This isn't a bug. You're probably using MapAndreas, right? It gets the highest z from ground.
You can use ColAndreas for this.
Reply
#3

Yeah, MapAndreas. So, I'll replace MapAndreas to ColAndreas?
Reply
#4

Yes, and you will also have to use the Raycast function.
Reply
#5

Could you...like...help me out, send a small tutorial? Thanks.
Reply
#6

I haven't really worked with AI NPC's a lot either.

This is from ToiletDuck:

Use RayCastLine x y z , targetx, tagerty,targetz when it returns to true then it means there is a wall between of it or there is IsPlayerBlock function use that.

x y z > GetPlayerPos(playerid) then Targetx,y,z = GetPlayerPos(targetid)

I hope you understand. or use 3dtryg of abyss use IsElementBetweenwall I forgot what is that function again lol
Reply
#7

I got it a little, might need more. Dw, I'll do sone research. Thanks!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)