I’m trying to move a simple Blueprint script that moves a static mesh when triggered into a function that can be called from outside the object. Sadly, MoveComponentTo is not available at all in the scope of the function I added to the Blueprint. Why is this? How can I get to it if possible?
In pic 1, you see the original bit of InteractiveDoor Blueprint. There is a Door static mesh that is being moved with MoveComponentTo.
In pic 2, you see the function on the same InteractiveDoor Blueprint and the missing MoveComponentTo both after a copy/paste and also in the search dropdown.
This is a limitation by design. In a function or macro, you can not have a latent node or anything that takes time, like timelines and delays. We have attempted to implement delay and timelines into functions and macros before, but it is only causing other issues to arise. This may be reopened and looked into at a later time.
And of course, a Move Component To has a latent based property from the “over time” variable
What you could do, is create a custom event that you call from inside the Function that connects to your Move To Component node outside of the function.
I ended up just leaving all of the actual functionality in the InteractiveDoor Blueprint instead of inside that function. Now, the function simply calls the custom event and the custom event is what triggers opening/closing the door.
I figured I could also use an Event Dispatcher, but decided to to try and see how this works for now since I can simply call a function ToggleDoor on the object from anywhere.