i know, this is very simple. First off, this is not going to be attached to my Enemy but i want to know if its possible to change the navmeshspeed from a script to my enemy. It is named “OGRE”. I need this script converted into Javascript, and i need it to somehow do it remotely without attach the script to the enemy.
Need this converted and remotely change speed:
GetComponent<NavMeshAgent>().speed = 6f;
Yes, I don’t know if its possible. Yes my “Enemy” is named “OGRE”. it would be very awesome if you could respond fast. Thanks!
Full script:
#pragma strict
var coinValue = 1;
function OnTriggerEnter(info: Collider)
{
if (info.name == "Player")
{
GameMaster.currentScore += coinValue;
Destroy(gameObject);
GetComponent<NavMeshAgent>().speed = 6f; // <---- Need this converted remotely!
}
}