Any way to modify gravity direction for actor?

its good to see the old “fixed z-gravity” problem is being worked on !!!

There were a few workarounds in UDK but now we have source access it will be awesome to see an axis indepedent gravity function :smiley:

We are investigating supporting varying gravity directions for Character movement. Applying a different gravity direction for physics objects should ‘just work’, once you make the change described above to pass it into SetUpForFrame.

I can help… I am a kind of game physics specialist and studied Physix a lot for Unity and other engines.

AddForce adds a perennial force in every physics update (i.e. gravity or rocket thrust…) , while addimpulse does it just once, as if firing a bullet.

Accelleration is calculated as A = F/M where F is force and M is body mass, so no need to use deltatime in either case, since Physix will take care of interpolating velocities due to accelleration

AddTorque works similarly but for angular (rotational) forces, the angular accelleration (a) is calculated similarly to forces but using the inertia tensor on each axis
so a = T/I , also here ignore deltatime

I’ve done that locally and it does just work if the gravity is constant at runtime but changing it on the fly needs each resting physics object to wake up otherwise it remains stuck to whatever surface, same with the character movement until the player walks or jumps.

do you know if there’s a way for GPU particles to receive an updated acceleration once they have been sent to the GPU? Or even if we can update acceleration the emitter module gives them?

This would be very nice! I’ve been stuck trying to do something with gravity here: CLICK ME FOR FORUM LINK. Having a variable gravity direction for character movement, if it’s toggleable with trigger volumes .etc could be very handy!

Currently GPU particles only support a constant acceleration. There’s no technical reason why that module need work any different than something like color/life where we could support a curve over the lifetime of the particle or of the emitter. This is on my list of changes I’d like to make.

That said, having a randomly selected acceleration per-particle would not be possible as it requires additional per-particle storage. I am doing my best to keep the memory and performance footprint of each particle as small as possible to preserve the “you get tons of these things” aspect of the system.

Sounds good!

I’m gonna have time to mess with this pretty soon, but was only able to find the CPU side stuff. Could you point me to the code that updates GPU particles, for example the constant acceleration module?

I’ve managed to get particles completely supported now, started my own thread for this stuff though.
Check it out here https://forums.unrealengine.com/showthread.php?6592-Unreal-Z-axis-independent-gravity

Can someone tell me how to modify the engine to get this result (in ue4)? https://www.youtube.com/watch?v=WPKQoR5XFU8

You can probably use this.

Here’s a video of what it can do (with a little code). https://www.youtube.com/watch?v=IW9E6XzfDbg

I’m just getting into U4 and I found this thread… I wonder why this isn’t already part of the engine? :confused:

It’s been a while now without any support for this. Is this still getting looked at? Was it looked at and thrown away?

Currently there’s no way to do a side view game that supports pathfinding on the side view plane and physics as neither doesn’t support custom axis and are setup for the ‘wrong’ axis for a game like that. Custom gravity would be a big selling point imho and very useful. Thanks.

I’d like to bump the question - any news on variable gravity directions or Character movement?

Bump Bump

It’s been moved from Backlog to May in Roadmap trello board so I guess it comes sooner than later!(But I doubt that it coming in May, afaik 4.12 release was scheduled for June)

Any news? I do not see this feature in the new roadmap.