I’vebeen trying to use a simple attach and detach script but it doesn’t want to work.
As you can see in the image, i attach my player to an actor. then when i press space (or in this case my actionmapping) i want it to detach. But it doesn’t. It plays the “hello” print string but it doesn’t detach.
BUT, if i add the delay function, it DOES actually detach after the delay is finished!
Is this a bug or does Unreal not support DetachFromActor with Input events?
… It looks like the detach doesn’t work if it’s called from ConstructionScript. If called from e.g. a function with CallInEditor, it woks ok. I’m trying to reproduce that cleanly now.
It also doesn’t work in 4.19, maybe in the earlier versions too. DetachFromActor doesn’t work when called from ConstructionScript, but works when e.g. called from a function with Call In Editor (button).
Generally we use this approach: (for example we want to attach/detach the player to a vehicle)
Calling AttachToActor in the player BP and supply vehicle BP as parameter.
Calling DetachFromActor in the same BP with parameter to vehicle BP.
This is not working, although seems only in specific conditions (maybe if the target actor already has attached another actors).
The “opposite” logic fixed the problem for me: I changed detach logic and called DetachFromActor from the vehicle BP with the player actor as parameter.