Hertzole / gold-player

A first person player controller for Unity.
MIT License
160 stars 16 forks source link

Can't set position through script #33

Closed Hertzole closed 4 years ago

Hertzole commented 4 years ago

When trying to set the player position through script using transform.position, it just doesn't work... sometimes. For unknown reasons, it sometimes works and sometimes doesn't.

Something in the PlayerMovement module is causing this behavior. Resetting moveDirection, movementInput and groundVelocity before setting the position does not help.

Hertzole commented 4 years ago

Apparently this is some character controller behavior. Others have experienced this, as seen here.

To "fix", Gold Player will get a SetPosition method to easily set the position.

Hertzole commented 4 years ago

SetPosition, SetLocalPosition, and SetPositionAndRotation added in https://github.com/Hertzole/gold-player/commit/c12129c3c020fd7acfe030a6d2caf6adda4d902b.