So I have a grabber component to grab objects and release them with a physics handle. What I am trying to do is, once I grab a mesh, physics simulation is activated but what I want is once I release the item and drops to the ground after 3 seconds to disable its physics.
I tried to do it via the Grabber.cpp USceneComponent but I have a hard time setting the FTimer Delegate.
Can you please either tell me what I am doing wrong or suggest another solution.
Have you used a timer successfully in the past? Why don’t you try setting a timer that logs a message with UE_LOG after a few seconds, just so you can figure out how to use timers (without complicating it with all the physics stuff)
is wrong. DisablePhysicsAtReleasedComponent is a void-returning function, so making a function call to it as an argument will never work. You need to refer to it as a pointer-to-member function like &UGrabber::DisablePhysicsAtReleasedComponent or, alternatively, call it in a lambda expression: [???] { DisablePhysicsAtReleassedComponent(???); } and pass the lambda expression as the argument.