So usually in games Enemies need to know where the player is.
That would require me to in an Enemy Script to get the player’s curernt position constantly.
In java that’s easy.
In the Enemies class you make a
Player p;
and then in the constructor you set p = the player given in the constructor list
and then in update()
theplayerX = p.getPlayerX();
But i know it doesn’t work that way in Unity C#.
How do i do it?
I’m raedy to start my game and that’s one of the basic things i need to do.
Get players variables or Get Objects positions
Like other things i would need to know is:
=Enemy should know if Player is punching him or if player is running away or if players energy level is low
You know things like that