Hi, I was wondering if it’s possible to have an object that would act like a drop indicator for the player, an indicator that wouldn’t show up if the player isn’t going to fall on a ground (like bottomless pit), it would only show up if the player is on the floor or is going to land on one, and no matter how high the player jumps it would remain in the ground, and if the player is moving, it moves horizontally with him, like in this image:
I think Raycast could be your solution for this but I never messed with it properly so I can’t suggest a proper solution right now. Check out some of the tutorials and examples regarding raycast, they should help.
UPDATE: So I looked back at the examples above, particularly the raycast debug view, at first I just took a look and tried to recreate it on my own, but that didn’t work, I couldn’t even get the raycast to visualize, but on the second try, I had an idea to just edit the raycast example, and it was successful, here’s the result:
Although there’s one last issue preventing it from being ideal, so in the game crates break and if the player breaks a crate (it acts like a platform too) the drop indicator doesn’t change its location until the player lands on another platform, now that’s for the crates, if player jumps from Platform 1 to Platform 2, the drop indicator doesn’t leave Platform 1 UNTIL player lands on Platform 2, here’s a video of it:
Best solution for this is probably hide the drop indicator whenever these happen, but I tried to make an inverted condition to hide it and now it’s always hidden, even if the original condition has “show object” in it, any help? This is the only event for it btw, turned out to be simpler than I thought
I played around a bit. This would change the opacity and the X scale of the shadow based on the distance from the bottom of the player and the nearest object. The clamp range and ratio can be adjusted.
I tried the first one, now it works as intended, I tried the second but I couldn’t really get the change opacity and scale stuff to work, it doesn’t accept the “Y-Player” part, but that’s okay, the first method is good enough for what I wanted to do, thanks a lot!
Player is the name of the object that I used. Y is the variable I used in the ray cast. I capitalized my X and Y mostly because I’m on my phone and it automatically capitalized it.
It’s your project and the choices are all yours. Be good.