Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

I need help fixing my current script

Discussion in 'Visual Scripting' started by Nrjplayz, May 24, 2021.

  1. Nrjplayz

    Nrjplayz

    Joined:
    May 24, 2021
    Posts:
    1
    I need help fixing my current script it is
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;

    public class playerlook : MonoBehaviour
    {
    public transform player;
    void Start()
    {public float MouseSensitivity = 10;

    }
    private float x = 0;
    private float y = 0;

    void Update()
    {

    }

    //input
    x += -Iput.GetAxis("Mouse Y") * MouseSensitvity;
    y += -Iput.GetAxis("Mouse X") * MouseSensitvity;

    //clamping
    x = Mathf.Clamp(x, -90, 90),(x, -90, 90);

    //rotation
    transform.localRotaion = Quaternion.Euler(x, 0, , 0);
    playerlook.transform.localRotation = Quaternion.Euler(0, y, 0);
     
  2. Valjuin

    Valjuin

    Joined:
    May 22, 2019
    Posts:
    481
    1. Check the layout of your code against the examples shown in this link:
    Learning C# and coding in Unity for beginners … https://unity3d.com

    2. Once you have corrected your layout, check your code for spelling and punctuation mistakes. If you use a code editor such as Visual Studio, any errors in your code will be highlighted as soon as they appear.

    3. This particular forum Is for Visual Scripting. Visual scripting, as described in the Unity manual, is a workflow that uses visual, node-based graphs to design behaviours rather than write lines of C# script.

    The forum for help with C# scripts is here: Scripting

    4. When posting code, please use code tags, as this makes it easier for people to read your code and, thus, increases your chances of getting help:

    upload_2021-5-25_15-58-2.png