Ok, so I am in the early stages of learning BP after using Unity for a couple years with basic C# (really more an assets guy). I am working on a prototype for a fps character controller that can enter trigger volumes that change the the direction of gravity (for MC Escher type situations).
An example level BP that does this for a certain volume is posted above.
(if there is a better way to achieve this result, I would certainly like to know! One major issue is that the player doesn’t move toward the wall on the Y axis until they have jumped to break the static friction.)
The real question, is how do I change the player character’s orientation, so that it now uses that Y axis as its new vertical, and grounds on the wall?
I have tried rotating the character controller, and the result seems to be that it rotates the collider capsule only, and the capsule still wants to ground on the normal floor even in new gravity zones, and the camera is still oriented the same way.
Well, from what I understand, the gravity still needs a bit of work, but you should be able to do a line trace to whatever surface you want to orient to, and get the normal of the hit surface, so if you do line trace to ceiling, normal should be something like -1 Z, so you can multiply that rotation by -1, this should also work with ramps.
How would I use linetrace in order to set the groundplane? I could export the normal vector of the hit surface, but how do I use this vector to set my new ground normal for the character?
Rotating the character controller is easy enough, and it rotates the capsule collider, but it doesn’t update the view system and the grounding. For instance, my view constaints, such as pitch constraints are still oriented to the regular ground plane, so what is my characters new yaw (which was his old pitch) is now constrained by the old pitch limits. I guess another way of putting it is that his view is constrained by global constraints, but I want them to be constrained by local, relative constraints.
This was a big one in UDK as well. A few guys made a run at it in C++ or Unrealscript never got it to work right as I remember. Unreal usually assumes gravity is pointing down. Even Spiderman would be oriented as if gravity is pulling him down. This does present a bit of an issue if you’re making something like the game Prey (which I think might have been UDK actually). The best solution was always to rotate the entire level around the player instead of trying to orient the player to the surface. But then the other characters would start tumbling around too I guess.
yeah, what I am trying to do is EXACTLY like “Prey”.
I have worked out a system that actually does do that- I created a class that contains a trigger volume, and it rotates the level around the player’s current location as its pivot when it is entered, and puts it back when you exit. If I can’t find a solution for wall walking, it is an ok compromise.
I just hope it scales up for larger scenes with more lights in them, and it does have the caveat of requiring dynamic lighting. I will post the class later when I have it cleaned up.
I was also interested in something like Prey. They have used IDTech4 in Prey, it must be something quite different.
Under UDK there were spider walking phys that could be used in the kismet.
In Unreal 4 Probably it can only be done using C++. Does anyone would create a BP node for it
by adding the quaternions option to prevent the Euler’s gimbal lock?
It’s hard, you can use force? But other than that, change the harcoded Z dependent gravity in UE4s code and change the code to axis-independant gravity, chould be much easier playing with global gravity now