Position Saver and Character Controller

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
HeroicMaou
Posts: 8
Joined: Thu May 30, 2019 6:53 pm

Position Saver and Character Controller

Post by HeroicMaou »

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.
User avatar
Tony Li
Posts: 22055
Joined: Thu Jul 18, 2013 1:27 pm

Re: Position Saver and Character Controller

Post by Tony Li »

Thanks for sharing!
Post Reply