I’m VERY new to Unity and made this code semi by myself, what’s the issue? btw i’m trying to make the player (capsule) rotate, which is where the problem is.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CapsuleMovement : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
//BASIC ahh wasd
if (Input.GetKey(KeyCode.A))
{
transform.position += new Vector3(0.2f, 0, 0);
}
if (Input.GetKey(KeyCode.D))
{
transform.position += new Vector3(-0.2f, 0, 0);
}
if (Input.GetKey(KeyCode.W))
{
transform.position += new Vector3(0, 0, -0.2f);
}
if (Input.GetKey(KeyCode.S))
{
transform.position += new Vector3(0, 0, 0.2f);
}
//BASIC ahh wasd
if (Input.GetKey(KeyCode.Q))
{
transform.rotation* Quaternion.Euler(0, transform.rotation.y + 1, 0);
}
}
}
(also idc too much if it works, i just want to fix the errors)
– andrew-lukasiktransform.rotation* Quaternion.Euler(0, transform.rotation.y + 1, 0);is not a valid syntaxWhat are you using to type your code?
– sacb0yAndrew has pinpointed the error and sacbOy asks a very good question. Having a decent code editor would have identified the line "as you were typing it". This type of problem is also a very good one for you to experiment with solving. Missing commas and semicolons are easy compared to what you will eventually encounter.
– tleylanbruh this was like a year ago i dont remember
– Monkey_Mode