✅ 4 compiler errors..I need someone to help me fix this
for anyone that is willing to help, here is the code:
using system.Collections;
using system.Collections.Generic;
using UnityEngine;
public class PlayerCam : Monobehaviour
{
public class float sensX;
public class float sensY;
public Transform orientation;
float xRotation;
float yRotation;
private void Start()
{
Cursor.lockstate = CursorLockMode.Locked;
Cursor.visible = false;
}
private void Update()
{
// get mouse input
float mouseX = Input.GetAxisRaw("Mouse X") * Time.deltaTime * sensX;
float mouseY = Input.GetAxisRaw("Mouse Y") * Time.deltaTime * sensY;
yRotation += mouseX;
xRotation -= mouseY;
}
}
you can check the compiler errors in the picture



11 Replies
This is nonsensical

Which probably causes all the other problems all the way down
So what is the solution?
Learn the very very basics of C# syntax
syntax error
plus
class float
is not a thing
learn to use the language properlyOk ok chill I’m new…I’m a transfer from C++ bcuz unity doesn’t work with C++
Can you like tell me what to put there?
Should I put public float instead of public class float?
Just searched up syntaxes
And it gave me this
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
Thank you
C++ and C# syntax is of course very different
that's fundamental to know
but tebeco provided you with valuable stuff
stick with em