20-06-2021, Saat: 17:32
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class playerMovement : MonoBehaviour
{
[Header("movement")]
public float moveSpeed = 6f;
float horizontalMovement;
float verticalMovement;
Vector3 moveDirection;
Rigidbody rb;
private void start()
{
rb = GetComponent<Rigidbody>();
rb.freezeRotation = true;
}
private void update();
void MyInput()
{
horizontalMovement = Input.GetAxisRaw("Horizontal");
verticalMovement = Input.GetAxisRaw("vertical");
moveDirection = transform.forward * verticalMovement + transform.right * horizontalMovement;
}
private void FixedUpdate()
{
void MovePlayer();
}
void MovePlayer()
{
rb.AddForce(moveDirection.normalized * moveSpeed, ForceMode.Acceleration);
}
kod bu. cs1002 ve cs1513 hatası alıyorum. hızlı cevap verirseniz sevinirim.
using System.Collections.Generic;
using UnityEngine;
public class playerMovement : MonoBehaviour
{
[Header("movement")]
public float moveSpeed = 6f;
float horizontalMovement;
float verticalMovement;
Vector3 moveDirection;
Rigidbody rb;
private void start()
{
rb = GetComponent<Rigidbody>();
rb.freezeRotation = true;
}
private void update();
void MyInput()
{
horizontalMovement = Input.GetAxisRaw("Horizontal");
verticalMovement = Input.GetAxisRaw("vertical");
moveDirection = transform.forward * verticalMovement + transform.right * horizontalMovement;
}
private void FixedUpdate()
{
void MovePlayer();
}
void MovePlayer()
{
rb.AddForce(moveDirection.normalized * moveSpeed, ForceMode.Acceleration);
}
kod bu. cs1002 ve cs1513 hatası alıyorum. hızlı cevap verirseniz sevinirim.