Quantcast
Channel: Answers by "RandomDeveloper"
Viewing all articles
Browse latest Browse all 8

Answer by RandomDeveloper

$
0
0
Maybe like this : //otherscript.js var health : int; var Maxhealth : int = 100; function Start (){ health = Maxhealth; } function Ouch (damage : int){ damage -= health; } //groundscript.js var player : GameObject; var FloorDamage : int = 40; function OnTriggerEnter(other:Collider){ player.GetComponent(otherscript).Ouch (FloorDamage); } I use this kind of thing a lot.

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>