#how to detect if player is at a ledge
30 messages · Page 1 of 1 (latest)
huh.
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
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
I'll make a free invention/room
nothing wrong with using inventions 🤪

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
I'll visualize it later
because you cant really detect a ledge
oh then just cast in the direction of Vector Scale((Vector Create(PlayerForward.x,0,PlayerForward.z), -1) then
btw the player forward.x is just vector split the direction and take the x output (I think)
same with z
yeah
because you cant really "split" a vector in text
so its easier to say Vector.Component
also how do u do the funny text
to inverse direction, else it casts in the direction away from player
backtick