Hello I have been trying to make a grapple hook/gun but its giving me this error
Assets/Scripts/Grappling.cs(9,13): error CS0246: The type or namespace name ‘PlayerMovementGrappling’ could not be found (are you missing a using directive or an assembly reference?)
This is my script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Grappling : MonoBehaviour
{
[Header("References")]
private PlayerMovementGrappling pm;
public Transform cam;
public Transform gunTip;
public LayerMask whatIsGrappleable;
[Header("Grappling")]
public float maxGrappleDistance;
public float grappleDelayTime;
private Vector3 grapplePoint;
[Header("Cooldown")]
public float grapplingCd;
private float grapplingCdTimer;
[Header("Input")]
public KeyCode grappleKey = KeyCode.Mouse1;
private bool grappling;
private void Start()
{
pm = GetComponent<PlayerMovementGrappling>();
}
private void Update()
{
if (Input.GetKeyDown(grappleKey)) StartGrapple();
if (grapplingCdTimer > 0)
grapplingCdTimer -= Time.deltaTime;
}
private void StartGrapple()
{
if (grapplingCdTimer > 0) return;
grappling = true;
RaycastHit hit;
if (Physics.Raycast(cam.position, cam.forward, out hit, maxGrappleDistance, whatIsGrappleable))
{
grapplePoint = hit.point;
Invoke(nameof(ExecuteGrapple), grappleDelayTime);
}
else
{
grapplePoint = cam.position + cam.forward * maxGrappleDistance;
Invoke(nameof(StopGrapple), grappleDelayTime);
}
}
private void ExecuteGrapple()
{
}
private void StopGrapple()
{
grappling = false;
grapplingCdTimer = grapplingCd;
}
}
If you can please help.