Move and keep actor at point with impulse/force

I’m trying to move an actor to a location in the air with impulse/force and it should continue to stay at the location with forces/impulses.

I’ve tried to do it with impulse/force based on a distance, but it’s not accurate; The actor always passes by the point with a too high velocity. Solutions I’ve come by are always changing the drag to a high level and but it feels like cheating.

The constraints I’d like to have would be with max acceleration and max velocity when it’s moving to the location.

Set up a timer by event… fast, .you’ll want to experiment with the timing and forces to make it do what you want exactly.

In the event…
Get your actor’s location, get unit direction from there to the target location.
make that a rotator and use that to get a forward vector.
Multiply your impulse into that to push it back toward the target.

Depending on how you have the object set up, you may have to use RightVector rather than forward. If it goes away from the target, reverse your get unit direction pins.

Hi @Enjoy… as you’ve likely come across by now… when using UE physics… to make this happen reliably using Impulse and Force, with the many possible combinations of physics object settings and world settings. There is also accounting for the tick rate, which will vary depending on the players’ systems.

Truly, such a simple thing becomes complex… which is why for simplicity, reliability and performance… many, many designers avoid purely physics solutions. So, if this would be an option I’d do the movement without physics :slight_smile:

If it was me, and I REALLY NEEDED a dynamic physics solution, I’d consider the following steps:

  • a fixed physics tick rate for your object
  • adding one or more PID controllers… maybe 1 to track rotation to target and 1 to track thrust (I think there are a few free on the marketplace, and I’ve posted here about them elsewhere)
  • experiment with the settings

Imho, it’s achievable, but physics isn’t really designed for an exact outcome every time.

Had a minute so I tossed in a character from another example I’m doing and made a location-correcting ball.
It starts out trying to find an orbit then settles in to the target location (0, 0, 0).

The map is less than a megabyte if you want to mess with it.
ImpulseCorrections.zip

You’ll notice I multiply the vector by 1, 1, 4
This lets the ball get past the default gravity and come to a stable resting point in the air.


To your problem with it passing the target…
You need a “catch” function.
Essentially you need to make a near-falloff to the impulse being applied and if necessary, apply impulse on a negative vector.

You can get pretty crazy with this stuff if you put in the time on the nodes. Personally I was never good with math, and less so vector math.

It’s totally achievable, the challenge is to get the action to happen reliably at (about) the same speed on many players’ machines (different frame rates). This consistency is (quite) achievable, but there is technically quite a bit to it… and there may be a few random physics glitches occasionally.

For this kind of thing, forces (over many frames) may be more useful than impulse (one frame).

Use of some lerps and a well-planned set of functions for handling various needs (rapid updates up close, slower but larger force changes at a distance) can be far superior to just slapping it in the backside with an impulse every .01 or so. Definitely.

As to uniformity, that’s why I never - Ever - suggest people use event tick for anything.
The example map I posted uses … I think it was… a .01 timer so it’s asking a lot, but since it’s just doing basic vector math and 1 execution, I think it would work just fine even on mobile.
But I think he’s looking for more handling than it provides… I just wanted to offer an example to show it can be done rather easily.

Yes, I’d definitely LERP or TIMELINE it… if possible instead of physics.

There are a few options to get more consistency in physics like substepping, timers, capping actor tick rate. There is also a plugin here on the forums written by an advanced used, used for advanced physics vehicles for this, though I’m not sure it has been modified for the new Chaos (before it was PhysX system).