the type or namespace name [hideininspector] does not exist

So, im creating a fps game. I got a code for controlling player movement and
the type or namespace name [hideininspector] show up in unity after i edit the playermovement.cs
how to fix

using UnityEngine;
using System. Collections;
public class PlayerMovement : MonoBehaviour {

public GameObject cameraObject;
public float acceleration ;
public float walkAccelerationRatio ;

public float maxWalkSpeed ;
public float deaccelerate = 2;
[Hidelnlnspector]
public Vector2 horizontalMovement;

[Hidelnlnspector]
public float walkDeaccelerateX;
[Hidelnlnspector]
public float walkDeaccelerateZ;

[Hidelnlnspector]
public bool isGrounded = true;
Rigidbody playerRigidBody;
public float jumpVelocity = 20;
float maxSlope = 45;
void Awake()
{
// [Getting the rigidbody component from player
playerRigidBody = GetComponent();
}
void Update ( )
{ Jump();
Move();
}
void Jump()
{
if (Input.GetKeyDown(KeyCode.Space) && isGrounded)
{
playerRigidBody.Addforce(0, jumpVelocity, 0);
}
}
void Move() {
//Controlling the limit of player by measuring the Vector 3 magnitude and then measuring and normalizing that vector
horizontalMovement = new Vector2(playerRigidBody. velocity.x, playerRigidBody. velocity. z);

if (horizontalMovement.magnitude > maxWalkSpeed)
{
horizontalMovement = horizontalMovement. normalized;
horizontalMovement *= maxWalkSpeed;
}
playerRigidBody.velocity = new Vector3(horizontalMovement.x, playerRigidBody.velocity.y,
horizontalMovement.y); //Controlling only X and Z speed of the cube movement

//Rotating the player capsule according to MouseLook current Y variable so that player looks exaclty where camera is looking .
transform.rotation = Quaternion.Euler(0, cameraObject.GetComponent() , currentY, 0);
//Moving here
if(isGrounded) //Complete control while player is on the ground

playerRigidBody.AddRelativeForce(Input.GetAxis(“Horizontal”) * acceleration, 0,
Input.GetAxis(“Vertical”) * acceleration);
else// [Complete control while player is in the air
playerRigidBody.AddRelativeForce(Input.GetAxis(“Horizontal”) * acceleration *
walkAccelerationRatio, 0, Input.GetAxis( “Vertical”) * walkAccelerationRatio

  • acceleration);
    if (isGrounded) // This section of code adds friction to player’s movement so that it doesnot slips when no force is aDDlied
    {float xMove = Mathf.SmoothDamp(playerRigidBody. velocity.x, 0, ref walkDeaccelerateX, deaccelerate);
    float zMove = Mathf.SmoothDamp(playerRigidBody. velocity. z, 0, ref walkDeaccelerateZ, deaccelerate);
    playerRigidBody.velocity = new Vector3(xMove, playerRigidBody. velocity. y, zMove);
    }

}
// this builtin method gets called whenever unity detects collision of two bodies
void OnCollisionEnter(Collision coll) {

foreach (ContactPoint contact in coll. contacts)
{
if (Vector3.Angle(contact. normal, Vector3.up) < maxSlope)//detecting
isGrounded = true;
}
}
//[Making player state in the air
void OnCollisionExit(Collision coll)
{
if (coll.gameObject.name.Equals (“Plane”)) {
isGrounded = false;
}
}
}

It’s hard to tell because you didn’t use code tags, but at a glance, everything seems fine in this script. But in your comment, you had full lowercase hideininspector, which could just be how you typed it. Otherwise, if you have hideininspector anywhere in another script, that would be your error source.

Should always use code tags and copy and paste the error so we can see the stack trace that goes with it. But double clicking the error should take you to where it is so you can check for typos.

You’re using L instead of capital i - you have HideLnLspector. Find/Replace “HIDELNLSPECTOR” with “HideInInspector”

Edit: replace HIDELNLNSPECTOR with HideInInspector, there’s no L characters. Search “HideL” on this page to see what I mean. The only time it’s spelled properly is in your OP.

Edit: …spelled properly aside from capitalization in your original post’s comment before the code (but not in your code)

1 Like

That was a good catch. Hideln and HideIn do look similar and I didn’t think to check op’s I vs L

1 Like

thank you

1 Like