Hi all.
I've been experimenting with another character controller recently in an attempt to achieve localised gravity zones using triggers.
I've been able to achieve this effect quite easily with rigidbody objects by simply setting Unity's global gravity to 0, 0 ,0 and then applying local forces to the rigidbodies as they enter the triggers. The character controller I've been using is also very basic (just movement and camera) and uses a non-kinematic rigidbody so it can be driven by forces. Currently I am reorienting the controller and camera when it enters a gravity trigger so that its up/down direction is the same as the trigger's Y direction.
However, I would very much like to replace this basic controller with UFPS and I realise that it won't simply be a case of swapping them out.
After a bit of playing around with the demo scene I'm starting to think that you're own Gravity Zone system may prove to be the answer.
I have a couple of questions though:
Currently the Gravity Zones are spherical and when a player is within one their local gravity is applied toward the centre of the sphere. Would it be possible to modify this ability so that instead of aligning towards the direction of a sphere's centre, it could instead align toward the local Y direction of a cube or mesh trigger instead?
And also, would it be possible to update this local gravity direction every frame? So that if the rotation of the gravity trigger were to change then the player's gravity and alignment would change with it?
I admit I have not spent an extensive amount of time diving into the ability system too deeply just yet, so I apologise if I may have missed something obvious. But any advice you could offer would be very much appreciated.
I've been experimenting with another character controller recently in an attempt to achieve localised gravity zones using triggers.
I've been able to achieve this effect quite easily with rigidbody objects by simply setting Unity's global gravity to 0, 0 ,0 and then applying local forces to the rigidbodies as they enter the triggers. The character controller I've been using is also very basic (just movement and camera) and uses a non-kinematic rigidbody so it can be driven by forces. Currently I am reorienting the controller and camera when it enters a gravity trigger so that its up/down direction is the same as the trigger's Y direction.
However, I would very much like to replace this basic controller with UFPS and I realise that it won't simply be a case of swapping them out.
After a bit of playing around with the demo scene I'm starting to think that you're own Gravity Zone system may prove to be the answer.
I have a couple of questions though:
Currently the Gravity Zones are spherical and when a player is within one their local gravity is applied toward the centre of the sphere. Would it be possible to modify this ability so that instead of aligning towards the direction of a sphere's centre, it could instead align toward the local Y direction of a cube or mesh trigger instead?
And also, would it be possible to update this local gravity direction every frame? So that if the rotation of the gravity trigger were to change then the player's gravity and alignment would change with it?
I admit I have not spent an extensive amount of time diving into the ability system too deeply just yet, so I apologise if I may have missed something obvious. But any advice you could offer would be very much appreciated.