Question by
BirchTree1205 · Oct 08, 2017 at 02:07 AM ·
scripting problemscript.scripting beginner
What is the new Get Tag From Raycast????
void FixedUpdate () {
// If the gun that's about to fire belongs to the player, and the fire button is pressed...
if (jetType.tag == "Player" && Input.GetButton ("Jump"))
ConsiderFiring ();
else {
// If this gun doesn't belong to the player, it must belong to an enemy
// Shoot a raycast out from the gun to determine whether its aim is near the player
if (Physics.Raycast.GetTagFromRaycast (transform.position, transform.forward, 100000) == "EnemyAI")
ConsiderFiring ();
}
}
Comment