#Lerp tracker with wall detection

11 messages · Page 1 of 1 (latest)

drowsy cloud
#
SLEEP 1
SET mons.Rot.Y trgt.Rot.Y
SUB R0 trgt.Pos.X mons.Pos.X
SUB R1 trgt.Pos.Z mons.Pos.Z
MUL R0 R0 DeltaTime
MUL R1 R1 DeltaTime
ADD mons.Pos.X mons.Pos.X R0
ADD mons.Pos.Z mons.Pos.Z R1
IF f.Trg.Active coll1
IF l.Trg.Active coll2
IF r.Trg.Active coll3
IF b.Trg.Active coll4
GOTO lup
LABEL coll1
SUB mons.Pos.Z mons.Pos.Z -0.01
SLEEP 0.01
IF f.Trg.Active coll1
GOTO lup
LABEL coll2
SUB mons.Pos.X mons.Pos.X -0.01
SLEEP 0.01
IF l.Trg.Active coll2
GOTO lup
LABEL coll3
SUB mons.Pos.X mons.Pos.X 0.01
SLEEP 0.01
IF r.Trg.Active coll3
GOTO lup
LABEL coll4
SUB mons.Pos.Z mons.Pos.Z 0.01
SLEEP 0.01
IF b.Trg.Active coll4
GOTO lup
``` too lazy to make a setup vid
#

trgt is the target block

neat atlas
#

what it do

drowsy cloud
#

uses lerp to track player /and or block

rose bramble
#

plz vido

coarse violet
#

Im dum what does lerp mean?

drowsy cloud
#

im too lazy but this is kinda the same system that the larry prefab uses for tracking but this one only does x and z

burnt thorn
#

`X = <———>

Y = ^
|
v

And z is forwards and backwards`

#

It broke

#

Dangit

steady moth
# coarse violet Im dum what does lerp mean?

Its actually just a way to smooth movement, and effectively smooth data to transform it into a differnt value
Its simplest form can be explained with the numbers 1 and 0
If I want to smoothly transition 1 to 0 then I can first divide it by 2 so I get half its value, for 0.5 so I do it again, 0.25, and eventually the object gets so close that grab just rounds its position to 0

To do this with numbers that arnt 0, you have to find the range, then divide then add that value to the moving object. Finding the range just makes the values treat them selves as if the goal position was 0.