Hi all, I was wondering if I could get some help with a problem I'm having.
The problem is that the start method in my child class is not being called.
So I have this parent class that loads a scriptable object as data in the start method:
public class Entity : MonoBehaviour {
public EntityData data;
// Start is called before the first frame update
protected void Start() {
LoadData(data);
}
public void LoadData(EntityData data) {
//boring data loading stuff
}
then I have a child class that inherits from this class:
[RequireComponent(typeof(Rigidbody2D))]
public class BasicChaser : Entity {
//targeting
private Transform target;
//movement
private Rigidbody2D rb;
protected new void Start() { //<- not called
base.Start();
rb = GetComponent<Rigidbody2D>();
}
public void Update{
rb.velocity = dir * data.speed; // <-rb is null, but data isn't
}
I have no idea what's going on, it was being called before, but i started working on something completely unrelated and it stopped working.
Any help would be appreciated. 🫠