Quantcast
Channel: Answers by "Matt-Downey"
Viewing all articles
Browse latest Browse all 90

Answer by Matt Downey

$
0
0
Ah, this seems to be the fault of not doing something like this instead: ball.timeToExplosion = length; Essentially, what you are doing is lacking the proper address to the variable you want to change. In order to make this work you have to make a few changes: 1) capitalize the "b" in your current "ball" class ("public class Ball") Note: I say this because it is convention to capitalize Classes and Functions for every word and use camelCase for any variables. 2) add this line in Start() or at the top: "public var ball : Ball = Ball();" 3) finalize by doing "ball.timeToExplosion = length;" to get the proper effect. again the periods are like an address. For an even more complex example look at this one: gameObject.thisScript.ball.timeToExplosion == Start at "gameObject"-->open component "thisScript"-->move to "ball" class-->access "timeToExplosion" variable in ball class

Viewing all articles
Browse latest Browse all 90

Trending Articles



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