"End" Key Function accessible in Blueprint?
I'm looking to write a Blutility that can take either all selected objects (or shortcut buttons for specific classes of objects, like PlayerStart) and then snaps them to the ground the same way the "End" key would.
I've written my own using LineTraceForObjects to start, but for PlayerStarts in particular it's not working in the same manner. It's actually aligning the origin of the object to the ground (which is what I'm telling it to do, of course) whereas with the End key it actually places the object appropriately above the ground by some amount.
So my questions are:
My first thought for #2 would be to find a collider and take half the height of it, but that's just a guess - I was hoping for something more substantiated.
EDIT: I've had pretty close to identical results using an explicit "92" offset to match the Capsule's half-height, but doing something more programmatically would be better so it can work with all objects as well as possible.
The "End" key is called "Snap to Floor" in the Editor Preferences.
Maybe search the engine source code project for keyboard shortcuts? Search for the "Snap to Floor" name or for its description: "Snaps the actor or component to the floor below it".
Making this in Blueprints doesn't seem very difficult. You create the "End" key (or whatever else) as an action mapping bind from the Project Settings - Engine - Input - Bindings, and if you press it, it moves the object down on the Z axis until it overlaps something, at which point you stop moving it. But not too fast, else it will most likely pass through everything on its way down.
Follow this question
Once you sign in you will be able to subscribe for any updates here