Answer the question
In order to leave comments, you need to log in
What to do with errors CS1525, CS1001, CS1026, CS1003?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlaerMufment : MonoBehaviour {
CharacterController cc;
Vector3 moveVec;
float speed = 5;
int laneNamber = 1,
lanesCount = 2;
public float FirstlanePos,
LaneDistance,
SideSpeed;
void Start()
{
cc = GetComponent<CharacterController>();
moveVec = new Vector3(1, 0, 0);
}
void Update()
{
moveVec.x *= speed;
moveVec *= Time.deltaTime;
float imput = Input.GetAxis("Horizontal");
if (Mathf.Abs(input) >.if);
{
laneNamber += (int)Matht.Sign(input);
laneNamber = Mathf.Clamp(laneNamber, 0, lanesCount);
}
Vectore3 newPos = transfore.position;
newPos.z = Mathf.Lerp(newPos.z, FirstLanePos + (laneNamber * LaneDistance), Time.deltaTime * SideSpeed);
transform.position = newPos;
cc.Move(moveVec);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question