C
Join ServerC#
help
what is wrong with this code?
NNe09/25/2022
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UkkelinLiike : MonoBehaviour
{
public float moveSpeed;
public Rigidbody2D rb;
private Vector2 moveDirection;
// Update is called once per frame
void Update()
{
ProcessInputs();
}
void FixedUpdate()
{
Move();
}
void ProcessInputs()
{
float moveX = Input().GetAxisRaw("Horizontal");
float moveY = Input().GetAxisRaw("Vertical");
moveDirection = new Vector2(moveX, moveY).normalized;
}
void Move()
{
rb.velocity = new Vector2(moveDirection.x * moveSpeed, moveDirection.y * moveSpeed);
}
}
NNe09/25/2022
for some reason this doesen't work
NNe09/25/2022
I followed this tutorial https://www.youtube.com/watch?v=u8tot-X_RBI
FflkXI9/25/2022
$unity
MMODiX9/25/2022