Why does My MainCamera revert to 0 on play?
https://www.youtube.com/watch?v=oVS2aLMIKx0&feature=youtu.be
Here is a video clip of the issue I am running into.
As far as I know, The animations and scripts have no issues. I just started getting back into developing video games and decided I'd use some of wows models for a place holder.
I can move along x and jump fine, look around fine, In scene I can see everything going on but as soon as I hit play everything in the "GAME" window disappears. (everything - is just my player model)
It's taken me roughly 2 days to develop this far and I'm starting to think I may have checked something off that shouldn't be checked off.
I'v'e back tracked as best I can and still no luck.
It appears the camera turns to a new direction on play How do I fix that? If I remove the MainCamera from my script.
heres an Example of what I mean using the begging of my script :
using UnityEngine; public class PlayerController : MonoBehaviour { public CharacterController characterController;
[Header("Camera")]
public Camera cam; <---------------- here
public float XSensitivity, YSensitivity;
public bool invertPitch, clamp;
public int minY, maxY;
public float InputX;
float InputY;
public Animator animator;
[Header("Movement")]
public bool grounded, jumping;
public float walkSpeed, sprintSpeed, jumpPower, gravity;
If I remove the camera from the object inspector I can see my guy fine when I hit play but can not move. If I add it, I cant see my player in Game, but can move again.
Your answer
![](https://koobas.hobune.stream/wayback/20220613002352im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why doesn't my object move when I use transform.position? 0 Answers
How should i go about having an object have 2 clickable areas? 2 Answers
UnityScript nested objects best practice 1 Answer
How do i make object when collided be cutted/culled? 0 Answers
How can I move two object next to each other while keeping their positions pixel perfect? 0 Answers