I know all here have many Projects and Work but us hopeful that anyone can help us.
We are an Academy for 3D Artist in Germany and like the Projects on our Students make alive to show up for the Gameindustrie.
We are no Programmer so we need help to create Template(s) to create good Portfolios for our Students.
We need for a Jump and Run Template for a Portolio to let the character run in a loop (like Sonic), we are no Programmer / Coder.
Also, we need exactly a Guide / Tutorial to Implement or a other way to do it.
Can anyone help us please.
Thank for share all you Knowledge on Forum you are really great community!!!
A Special thanks to for sharing code
Sorry if is a noobish question, but how do I now use that updated code?
At the moment I do a line trace from my character to the center of an object (in my case a sphere). I understand that I need to break the hit > get the normal > reverse it, but what do I do then? I’ve tried plugging that result into the Set Gravity Direction node but that’s not giving the desired result. I read something about applying a rotation to the CapsuleComponent of the character?
I think you’d help out alot of people if you’d explain how to use logic in blueprints.
The code you quoted takes floor normal (if there is any) and changes gravity direction each frame, so it might ignore any use of the “Set Gravity Direction” node in blueprints.
I try to update client to not fall, but with no result yet It seems gravity scale and rotation works but not movement direction Anyone can help me with ?
I am very confused because on client there is 4x more code executing. It seems server run his own gravity code with different gravity direction. That’s why even with no gravity client jitters.
When I remove ReplicateMoveToServer gravity works fine, but I need replication so I am working on it. Right now it works OK but adding forces so my character is all shaking. Playable but I want to get rid of mystical force and try to make simple replication. Any ideas?
I have no idea how to implement into my build of UE4.
I’ve downloaded 4.7.6 source from github. I’ve changed the code.
When I build it gives me almost 100 errors.
If there’s anyone who could lead me through the proces, explain like I was 2 year old child, how to do that, I’d be grateful… PM me maybe. Thanks.
First, we have to think big. As in planetary bodies. Gravity should be treated as a force vector, proportionate to a mass ratio of a physical body (such as earth). The amount of gravitational force applied to a body is something like an inverse square law of its distance from that object (I’m sure a good physics book has a precise equation). If you have two bodies which exert gravitational forces on an object (such as the Earth and Moon), then to find the gravitational force vector applied to an object, we’d have to go through all gravitational forces, figure out the gravitational force from distance X towards the center position of each body, and come up with a sum of gravitational forces vector. force vector can then be applied as an acceleration force.
Optimization:
I think that may get computationally expensive with a lot of gravitational bodies, especially if they’re dynamic. I think that if you at least have a bunch of static gravitational bodies, you could go through chunks of 3D space and pre-generate a vector field which would suggest the sum of all gravitational forces at some position. The gravitational force applied could be determined by which cell you’re occupying and then querying its gravitational vector, and then applying it to the bodies in that field.
The “up” vector is an interesting one. As far as cameras are concerned, I’d keep the game model up vector unchanged, regardless of gravity because it keeps rendering consistent. But the “up” vector which suggests an up orientation could be set to the normalized inverse of the gravitational force vector. Jumping would cause an impulse force on vector (etc, etc).
Hi, I’ve been adapting the code to the 4.9 version, I spent some hours on doing it ( is my first modification on the ue source code) and I want to share adaptation with anyone who wants (and, like me, cannot wait to epic to implements it).
I think there are some bugs, but it works well on my side scroller game. I will do some improvements on the next days