i dont understand what this error message means and im trying to add movement, the code hasnt changed but hwne i went to add something it gave me this error. i ctrl z but it still didnt work. What do i do?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyMovement : MonoBehaviour
{
public float moveSpeed;
public Rigidbody2D rb2d;
// Start is called before the first frame update
void Start()
{
rb2d = GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update()
{
rb2d.velocity = Vector2.left * moveSpeed;
}
}
You seem to have two scripts called the same thing. You probably have accidentally duplicated your script.
is it possible to have different consoles for different debug logs? i have multiple debug logs throughout my script but they all go through the same console and you can see whats happening rlly so ye
Is this related to the above problem?
Read the docs on Debug.Log so you can see that there’s a second parameter that lets you give the log entry context: https://docs.unity3d.com/ScriptReference/Debug.Log.html
As my predecessor wrote. You have two scripts/classes with the same name. If you want to keep both, use namespace on one.
there is only 1 console but the link spiny199 gave:
https://docs.unity3d.com/ScriptReference/Debug.Log.html
Also shows how to set the color of logs, this makes it easier to see different ones.