i need an urgent fix please help its for an assignment
pythex
0
Reputation points
#if ENABLE_INPUT_SYSTEM
using UnityEngine
InputSystem;
#endif
using UnityEngine;
#if ENABLE_INPUT_SYSTEM
public class Character_move : MonoBehaviour
{
CharacterController cha;
Vector3 move_speed;
float gravity=-9.8f;
float jump_speed=0.5f;
void Start()
{
cha=GetComponent<CharacterController>();
}
void Update()
{
move_speed=new Vector3(Input.GetAxis("Horizontal"),move_speed.y+gravity*Time.deltaTime,Input.GetAxis("Vertical"));
if(Input.GetKeyDown(KeyCode.Space))
{
move_speed.y=jump_speed;
}
cha.Move(move_speed);
}
#endif
}
#if ENABLE_INPUT_SYSTEM
}
#endif
public class character : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
Community Center | Not monitored
46,246 questions
Sign in to answer