#Ai pathfinding (2 code blocks also sometimes gets stuck)

1 messages · Page 1 of 1 (latest)

lyric dome
#

move is the group of triggers

rocky grove
#

NO WAY

#

TYSMM

lyric dome
#

yus

rocky grove
#

setup?

lyric dome
#

oh ye right

rocky grove
#

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

lyric dome
#

you can copy it by using the copy icon on the thing at the top right

rocky grove
#

what i do wrong

lyric dome
#

lemme join ima see whats wrong

#

wait i see whats wrong

#

you forgot the goto on left2

rocky grove
#

?

#

i cnp it

lyric dome
#

look at the original code at the last one and yours that you copyed

rocky grove
#

fixed it

lyric dome
#

it gets stuck on corners

lyric dome
#

yoy

hot idol
surreal veldt
#

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.

surreal veldt
#

I made it!

#

I works 35% of the time.

hot idol
surreal veldt
hot idol
#

Why not

surreal veldt
#

sure I was about to get on the code is gonna be 112233

hot idol
simple rune
#

is 1 front and 2 back?

#

And also what do i make the triggers do

lyric dome
lyric dome
soft parrot
#

what are the connections?

soft parrot
#

okay i got it working but

covert bone
#

does this just turn to the side if it hits a wall

#

?

surreal veldt
#

if it touches a corner.

simple rune
#

trigger

surreal veldt
#

the code with like. Four lines.

lyric dome
supple sonnet
slender verge
real goblet
#

roblox toolbox ahh monster

dry fox
#

for the connections what blocks are the ones you use

surreal veldt
#

J

stray horizon
#

Cool

royal fiber
#

poopi sahur

#

ima try it

stray horizon
#

WHAT

#

Same

royal fiber
#

setup vid??????????

lyric dome
royal fiber
#

ok

#

which one

royal fiber
#

its dooki no offense

#

i tried

#

he just clipped through wall

lyric dome
#

let me see whats wrong

royal fiber
#

its gone but

#

i deleted

lyric dome
#

did you make the triggers block activated

royal fiber
#

yes

#

it worked

#

but he sometimes clipped

#

its ok ima just do smth else ty tho

lyric dome
#

you just have to make the walls thicker

supple sonnet
#

Path finding should be a block

surreal veldt
#

It’s pathfinding its way to the player.