Please help! ![]()
when I am going to support soldier and colliding to him, THE GUITEXT text IS NOT CHANGING!!!
I am sure my code is right!
ok thankx for any help ![]()
HEre is script:
var targetGuiText : GUIText;
function Start()
{
targetGuiText.text = "Objective: find a support soldier";
}
function OnCollisionEnter(collision : Collision)
{
if (collision.gameObject.name == "supportSoldier")
{
targetGuiText.text = "Objective complete!";
}
}
If anyone didn't notice there is more code. It's just above the code block.
– MinerJohnJust a quick question, you are attaching the script to the player right?
– MinerJohnyes right.
– blackshtormxIf your soldier is using a character controller you might have to use OnControllerColliderHit() rather than OnCollisionEnter()
– Josh707