Position Saver and Character Controller
Posted: Tue Jun 04, 2019 4:01 pm
I just wanted to make this post in case someone who isn't too familiar with the Character Controller component has this problem as well.
If you use CharacterController.Move(), namely if you always call Move() with your input and Update, Position Saver wont be able to set your players position.
I had a problem earlier where the Demo scene worked when transitioning between scenes, but for some reason my own made character script wouldn't work. It always reset to its position I set in the editor. I started to troubleshoot which parts of the script were causing this, and it was my Movement and Jump portions of the script. I already incorporated bools to block movement, jumping, and attacking if needed so it was an easy fix. At scene start, everything is blocked and after the position is set, I activate it all again.
I don't know how well known this kind of knowledge is, but I've been using Unity for awhile and had no idea the Character Controller component worked this way as I usually use Rigidbodies exclusively. I searched these forums a bit and couldn't find the answer so I hope it's okay to leave this one.
If you use CharacterController.Move(), namely if you always call Move() with your input and Update, Position Saver wont be able to set your players position.
I had a problem earlier where the Demo scene worked when transitioning between scenes, but for some reason my own made character script wouldn't work. It always reset to its position I set in the editor. I started to troubleshoot which parts of the script were causing this, and it was my Movement and Jump portions of the script. I already incorporated bools to block movement, jumping, and attacking if needed so it was an easy fix. At scene start, everything is blocked and after the position is set, I activate it all again.
I don't know how well known this kind of knowledge is, but I've been using Unity for awhile and had no idea the Character Controller component worked this way as I usually use Rigidbodies exclusively. I searched these forums a bit and couldn't find the answer so I hope it's okay to leave this one.