I am trying to make a bounce pad that will work with not only the play, but also any other actor that gets put on top of it. I tried looking it up and found only videos showing how to do it to your character, but that is not what I am looking for. This is the set-up I am working with :
There’s a few ways that Actors can move in Unreal Engine.
There’s Pawns, that are typically moved with forward kinematics (direct calculation/updates) rather than using the physics rigid body system. Depending on which Movement Component is added to the Pawn, the Pawn may or may not support velocity-based movement at all. (Check for example the Rotation movement controller.) To “fling” one of these objects, you need to stimulate the movement controller in the appropriate way, which may be different for each movement controller. (For example, Chaos Vehicle Physics is implemented differently from Character Movement Controller.)
Then there’s regular Rigid Body physics simulation. This is what you’ll typically add to your crates and barrels and other interactable objects. Also, if you build “physically based movement” yourself, you might use this system in your own movement controller (or just mash it into the Actor Tick function, I don’t judge. Much.)
So, when an actor overlaps your jump pad, how do you “fling” it? Well, that depends on the particulars of that kind of actor! If the actor is simulated using physics, use something like AddImpulse. If the actor is simulated using the CharacterMovementComponent, you might also be able to use AddImpulse() or AddForce() (It’s a virtual in the base movement component,) but exactly how the controller implements this, depends on each specific controller, and you’ll have to experiment/read-code for each of them to see how they behave.
One of the main issues with how I deal with character movement is that the character is not moved with a character controller and instead is basically controlling a physics object.
Updated Reply, both the player and other actors use simulated physics, however, when I try to use “AddImpulse”, it will not allow me to use the actor, but allows me to use component.
Indeed, the units in the Unreal engine make physics ridiculously hard to think about – very large values for forces and torques are needed…
And it’s funny that you multiply by mass, because the controller will then divide by mass again If you set “Vel Change” to true, it will internally multiply by mass instead (or not divide by mass – same thing.)
The implementation for FBodyInstance does this with an if statement:
if (FPhysicsInterface::IsInScene(ActorHandle) && IsBodyDynamic(ActorHandle, bIsInternal))
{
if (bVelChange)
{
FPhysicsInterface::AddVelocity_AssumesLocked(ActorHandle, Impulse, bIsInternal);
}
else
{
FPhysicsInterface::AddImpulse_AssumesLocked(ActorHandle, Impulse, bIsInternal);
}
}