This is my script
my problem
AssetsscriptsSwinging.cs(2,1): error CS0106: The modifier ‘private’ is not valid for this item
using UnityEngine;
private void StopSwing();
{
lr.positionCount = 0;
Destroy(joint);
}
void Update()
{
if (Input.GetKeyDown(swingkey)) StartSwing();
if (Input.GetKeyUp(swingkey)) StopSwing();
}
[Header("Swinging")]
LineRenderer mr;
public Transform GunTip, cam, player;
public LayerMask whatIsGrappleable;
[Header("Swinging")]
float maxSwingDistance = 25f;
private Vector3 swingPoint;
private SpringJoint joint;
void StartSwing();
RaycastHit hit;
if (Physics.Raycast(cam.position, cam.forward, out hit, maxSwingDistance, WhatIsGrappleable))
swingPoint + hit.point.
joint = player.gameObject.AddComponrnt<SpringJoint>();
joint.autoConfigureConnectAnchor = false;
joint.connectAnchor = swigPoint;
float distanceFromPoint = Vectr3.Distance(player.position, swingPoint);
// the distance grapple will try to keep from grapple point.
joint.maxDistance = distancefroemPoint * 08;
joint.minDistance = distanceFromPoint * 025;
//custimize values as you like.
joint.spring = 45f;
joint.damper = 7f;
joint.massScale = 45;
lr.positionCount = 2;
currentGrapplePosition = gunTip.position;
void DrawRope()
{
// if not grappling, don't draw rope
if (!joint) return;
currentGrapplePosition = Vector3.Lerp(currentGrapllePosition, swingPoint, Time.dellaTime * 8f);
lr.SetPosition(0, gunTip.position);
lr.SetPosition(1, swingPoint) ;
}
void LateUpdate()
{
DrawRope();
}
i tried to remove the modefier private bust i get more problems
its hard to solve and i need some help
pls help me