withoutanswers
Ty
Ireland
Currently Offline
Comments
Malpractice Lawsuit 8 May, 2021 @ 3:49pm 
+rep

using System.Collections;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Threading;
using UnityEngine;

public class FPSInput : MonoBehaviour
{
public float speed = 6.0f;
private CharacterController _charController;

// Start is called before the first frame update
void Start()
{
_charController = GetComponent<CharacterController>();
}

// Update is called once per frame
void Update()
{
float deltaX = Input.GetAxis("Horzontal") * speed;
float deltaZ = Input.GetAxis("Vertical") * speed;
Vector3 movement = new Vector3(deltaX, 0, deltaZ);
movement = Vector3.ClampMagnitude(movement, speed);

movement *= Time.deltaTime;
movement = transform.TransformDirection(movement);
_charController.Move(movement);
transform.Translate(deltaX * Time.deltaTime, speed, deltaZ * Time.deltaTime);
}
}
Myitraxz 11 Jun, 2020 @ 5:49am 
:jarate:
SENSETiVE 26 Apr, 2020 @ 1:47pm 
Just a sound guy :steamsalty: