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);
-
Check the layout of your code against the examples shown in this link:
Learning C# and coding in Unity for beginners … https://unity3d.com
-
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.
-
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
- 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: