#how to detect if player is at a ledge

30 messages · Page 1 of 1 (latest)

royal hazel
#

quick question is it only one ledge in the map, or is there alot

#

cus u could easily do a trigger volume

#

ummm ok

#

we need cryptic on this one

hasty wind
#

huh.

royal hazel
#

I mean you could have like a circle around the player and if there's nothing underneath a part of it your on a ledge

#

idk how to do with vectors lol

hasty wind
#

Cast from the ground position of the player - threshold value

Cast in the direction towards the player, ignore Y axis

You will have to use multiple raycasts or run multiple iterations

royal hazel
#

nothing wrong with using inventions 🤪

hasty wind
#

Run a loop between [0,X] with "X" being how much precision you want

Rotate vector (0,0,DistanceThreshold) by Quaternion Create Angle Axis(((LoopIndex/MaxLoopIndex) * 360)(0,1,0)

Add that to the Ground Position - YAxisThreshold

Cast in the direction of Rotate vector((0,0,-1),Quaternion Create Angle Axis(((LoopIndex/MaxLoopIndex) * 360)(0,1,0)

#

yes

royal hazel
#

I'll visualize it later

hasty wind
#

because you cant really detect a ledge

royal hazel
#

I gotta go to school 🎒

#

I know how to do that but I forgor chips

hasty wind
#

oh then just cast in the direction of Vector Scale((Vector Create(PlayerForward.x,0,PlayerForward.z), -1) then

royal hazel
#

btw the player forward.x is just vector split the direction and take the x output (I think)

#

same with z

hasty wind
#

because you cant really "split" a vector in text

#

so its easier to say Vector.Component

royal hazel
#

also how do u do the funny text

hasty wind
#

to inverse direction, else it casts in the direction away from player

hasty wind
royal hazel
#

'is this is'

#

shit balls

#

umm

#

found it