using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMove : MonoBehaviour
{
private PlayerInput playerInput;
private PlayerInput.OnFootActions onFoot;
private Vector2 input;
private Vector3 Direction;
public float speed = 5.0f;
public bool isGrounded;
public float jumpHeight;
private Rigidbody2D rb;
// Start is called before the first frame update
void Awake()
{
playerInput = new PlayerInput();
onFoot = playerInput.OnFoot;
rb = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
public void OnTriggerEnter(Collider other)
{
isGrounded = true;
}
public void OnTriggerExit(Collider other)
{
isGrounded = false;
}
public void Jump ()
{
if(isGrounded == true)
{
// CS0029 occurs here.
// Tried byte, short, int, long, float, and double and none work.
rb.velocity = (0, 1);
}
}
void Update()
{
onFoot.Enable();
Direction.x = input.x;
input = (onFoot.Movement.ReadValue<Vector2>());
transform.position += (Direction * speed * Time.deltaTime);
}
}
Error: CS0029
Why does it not accept any value types? Even in regular rigidbody, still…
If you know the fix, please tell me.
By the way, the PlayerInput is a reference to the action maps I have.
Thanks in advance.