Search Issue Tracker
Fixed
Votes
0
Found in
5.0.0b14
Issue ID
651362
Regression
No
FirstPersonController movement doesn't work, script throws not valid localRotation error
1. Create any project
2. Add Standard Assets Utility, Characters
3. Add prefab FPSController
4. Play the scene
5. You are going to get error "transform.localRotation assign attempt for 'FirstPersonCharacter' is not valid. Input rotation is { NaN, NaN, NaN, NaN }."
I assume you forgot to:
FirstPersonController.cs
private void RotateView()
{
m_MouseLook.LookRotation (transform, m_Camera.transform);
//was MouseLook.LookRotation (transform, m_Camera.transform);
m_CameraRefocus.GetFocusPoint();
}
MouseLook.cs
private void Start()
{
m_CharacterController = GetComponent<CharacterController>();
m_Camera = Camera.main;
m_OriginalCameraPosition = m_Camera.transform.localPosition;
m_CameraRefocus = new CameraRefocus(m_Camera, transform, m_Camera.transform.localPosition);
m_FovKick.Setup(m_Camera);
m_HeadBob.Setup(m_Camera, m_StepInterval);
m_StepCycle = 0f;
m_NextStep = m_StepCycle/2f;
m_Jumping = false;
m_AudioSource = GetComponent<AudioSource>();
m_MouseLook.Init (transform, m_Camera.transform);
//was whitout m_MouseLook.Init,
//because u were multiplying quat by zero
}
Any way, movement also isn't working.
Reproduced: 5.0.0b15
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android] Audio sound is lower in the Player compared to the native music player
- Feet slide and misalign when playing retargeted animations
- IndexOutOfRangeException is thrown in NativePassCompiler when a graphics buffer is used in more than 5 render passes
- "Undo Stack Overflow" error is thrown, and Undo History is deleted when multiselected GameObjects are reparented to their GrandParents
- SearchColumn of type "ObjectReference" does not get refreshed for the custom SearchProvider when lighting generation finishes
Add comment