here is the problem
Assets\playermovement.cs(41,37): error CS1503: Argument 1: cannot convert from ‘double’ to ‘float’
and here is the script pls help
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playermovement : MonoBehaviour
{
public CharacterController cont;
public float speed = 0.4f;
public float gravity = -0.01f;
public Transform check;
public float gd = 0.04f;
public LayerMask groundMask;
public float jump = 1f;
Vector3 velocity;
bool isGrounded;
// Update is called once per frame
void Update()
{
isGrounded = Physics.CheckSphere(check.position, gd, groundMask);
if(isGrounded && velocity.y < 0)
{
velocity.y = -0.2f;
}
float x = Input.GetAxis("Horizontal");
float z = Input.GetAxis("Vertical");
Vector3 move = transform.right * x + transform.forward * z;
cont.Move(move * speed * Time.timeScale);
if(Input.GetButton("Jump") && isGrounded)
{
velocity.y = Mathf.Sqrt(jump * -0.7 * gravity);
}
velocity.y += gravity * Time.timeScale;
cont.Move(velocity * Time.timeScale);
}
}