|
Post by codeassembler on Feb 14, 2017 2:26:56 GMT
Hi all, hope all is great with your projects! The issue I'm experiencing is that if my notebook is not connected to the power outlet, the character slowly comes forward in Z axis as I turned from Left to Right. This happen even when I have double checked that the Freeze Position Z is checked. I suspect this is because right now I'm using the default animations that comes with the Plugin, rather that my own (say instant 180 degrees or similar). So it seems that when the Character Rotation animation is triggering it is actually moving on the Z axis by an offset that is constantly being added until the Characters leaves the designated area. I also suspect I should need to provide colliders to help the Character to stay in place. However if I do this, I suspect that then when the game action kicks in and one start running and jumping around colliders shouldn't be the only thing I should depend on to stop the character from actually moving in the Z axis. I'll proceed to work out two things: 1) Set a FixedUpdate() call back where I enforce the Freeze Position Z. 2) Verify the animations and see if I can stop them from turning that smooth so it has lower margin from moving on the Z axis. If you do know of something easier to do in order to help my SideController stick to the Freeze Position Z Constraint, please do let me know! thanks in advanced for any help! - Luis
|
|
|
Post by codeassembler on Feb 14, 2017 5:58:51 GMT
If anyone is interested on how I solved this one, this is what I opted to do. It worked flawless, regardless of the low/poor performance conditions at the PC:
On the vThirdPersonController I added functionality to make sure the Z Position is constrained. Just make sure that you also include the Rotations on the constrains.
m_RigidBodyConstrains = RigidbodyConstraints.FreezePositionZ | RigidbodyConstraints.FreezeRotation;
Then assign those at FixedUpdate() updates on the same script.
Note I noticed that the Field : "Free Rotation Speed" of the vThirdPersonController helped a lot in trying to keep the character locked at its Z world axis position, since if you set it high enough it can instantly switch the direction of the character, minimizing the risk of walking at Z world axis during the turn animation on slower systems. However I didn't feel confortable enough with this solution. So I went with a FixedUpdate lock.
Also since I did freeze by FixedUpdate means I can then set the "Free Rotation Speed" to a lower value and get a bit of cool transition effect when switching left / right directions.
Hope this info be of helps to others with the same project requirements.
- Luis
|
|