#Ai pathfinding (2 code blocks also sometimes gets stuck)
1 messages · Page 1 of 1 (latest)
yus
setup?
ty
SET Player.SelId Player.LocalId
SET Player.SelPart 1
SET R7 1.5
LABEL loop
SET rit1.Pos.Y 1.5
SET lft1.Pos.Y 1.5
SET lft2.Pos.Y 1.5
SET rit2.Pos.Y 1.5
IF rit1.Trg.Active right
IF lft1.Trg.Active left
IF lft2.Trg.Active right2
IF rit2.Trg.Active left2
SUB R0 Player.Pos.X bot.Pos.X
SUB R1 Player.Pos.Z bot.Pos.Z
ATAN2 bot.Rot.Y R0 R1
COS R0 bot.Rot.Y
MUL R0 R0 R7
MUL R0 R0 DeltaTime
SIN R1 bot.Rot.Y
MUL R1 R1 R7
MUL R1 R1 DeltaTime
ADD bot.Pos.X bot.Pos.X R1
ADD bot.Pos.Z bot.Pos.Z R0
GOTO loop
LABEL left
ADD bot.Rot.Y bot.Rot.Y -15
ADD bot.Pos.Z bot.Pos.Z -0.02
ADD bot.Pos.X bot.Pos.X -0.02
ADD rit1.Pos.Y rit1.Pos.Y 100
GOTO loop
LABEL right
ADD bot.Rot.Y bot.Rot.Y 15
ADD bot.Pos.Z bot.Pos.Z -0.02
ADD bot.Pos.X bot.Pos.X 0.02
ADD lft1.Pos.Y lft1.Pos.Y 100
GOTO loop
LABEL right2
ADD bot.Rot.Y bot.Rot.Y -15
ADD bot.Pos.Z bot.Pos.Z 0.02
ADD bot.Pos.X bot.Pos.X -0.02
ADD lft2.Pos.Y lft2.Pos.Y 100
GOTO loop
LABEL left2
ADD bot.Rot.Y bot.Rot.Y 15
ADD bot.Pos.Z bot.Pos.Z 0.02
ADD bot.Pos.X bot.Pos.X 0.02
ADD rit2.Pos.Y rit2.Pos.Y 100
you can copy it by using the copy icon on the thing at the top right
look at the original code at the last one and yours that you copyed
it gets stuck on corners
yoy
sup
I’m gonna make this but once it hits a wall it’ll avoid it.
so it like walks away from the wall to the closest path to the player.
Can i join you
Why?
Why not
sure I was about to get on the code is gonna be 112233
What is your is your Username
yes
it makes so the monster doesnt noclip
what are the connections?
no it just goes around corners
if it touches a corner.
yes but what do i make them triggee
trigger
the code with like. Four lines.
no me too stupid to do dat
Where is your pathfinding you said you gonna make
He made it and now he’s gatekeeping
roblox toolbox ahh monster
for the connections what blocks are the ones you use
J
Cool
setup vid??????????
i made a better one
let me see whats wrong
did you make the triggers block activated
you just have to make the walls thicker
Path finding should be a block
???
It’s pathfinding its way to the player.