I have an actor blueprint which places a platform in a level. Now, this platform has legs, Ideally, I would like the legs to automatically stretch and reach the floor where ever they are placed in the level. I think I can do the scaling okay what I’m not sure how to do is detect the distance to the floor. I would also like to do a similar thing with walls.
2 - to determine the size of the leg, I use this script in the constructor, which will use linetrace to get the distance between the pivot point of the leg to the floor (or any other obstacle below), and with that will set the scale of the leg in the Z axis: