Hello guys. I have a situation with my game. I am using ARFoundation , i am scaning a floor with PlaneManager and i am placing a prefab which is my whole level.
When i placed the prefab time scale is 0 and all are in the right position.
I have a PLAY button on my screen which i just change the timeScale and a starts some coroutines.
When i press Play the ‘‘enemies’’ jumps to a different Y position.
I try to use gravity ,or initialize Enemies position nothing works. The enemies they haven’t animation or changing position in some Start() method. When i disable NavMesh Agent the enemies are in the right position but they can’t move of course.
This is the Awake() code:
void Awake()
{
GetComponent<AudioSource>().playOnAwake = false;
agent = GetComponent<NavMeshAgent>();
// Disabling auto-braking allows for continuous movement
// between points (ie, the agent doesn't slow down as it
// approaches a destination point).
agent.autoBraking = false;
agent.speed = 0.5f;
checkEnemy = 1;
timepassed2 = tenSec2 * 1;
//Set the PlayerHealth
currentHealth = maxHealth;
healthBar.SetMaxHealth(maxHealth);
//Using Warp for change with serialized field the position but it's not working
agent.Warp(startPosition);
print(transform.position);
}
Any thoughts??? HELP <3