everybody. I'm beginner unity user. When i study unity. my C# script file doesn't insert to prefabs. And it return error message : The script don't inherit a native class that can manage a script.
this is my C# script code.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class unPlayerMovement
{
private Transform tr;
public float moveSpeed = 30.0f;
public float rotSpeed = 150.0f;
// Start is called before the first frame update
void Start()
{
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
tr = GetComponent<Transform>();
}
// Update is called once per frame
void Update()
{
float h = Input.GetAxis("Mouse X");
float v = Input.GetAxis("Vertical");
Move();
}
void Move(float h, float v)
{
tr.Rotate(0, v * moveSpeed * Time.deltaTime, 0);
tr.Translate(0, 0, h * rotSpeed * Time.deltaTime);
}
}
And this is my Unity screen.