I lost where I’d seen this … how to reference a variable in script a when you are running script b.
In my start script I have an awake function.
When I click a button that has playagain.js I need it to set Time.time back to zero. Time.time is in the timer.js script and runs a clock down. Time.time I think runs from the start of the game or on loadlevel? So I put something in the awake function or maybe write a new start function (after thew awake) in my start script that will do that.
DaveyJJ,
I was trying to do your “simple unity tutorial” and reset the time as well… (if this is what you are doing) you may want to check out On The Edge - Det bedste fra tech verdenen and see if this will help what you are trying to do.
Let me know how it goes as I would like to reset the time as well
Not sure you can set Time.time to zero. If not, just save it’s value (when you would normally try to reset it) and subtract that value from any “time” you might need.
I’d like to reference an instance of a script that is attached to an object when another object collides with it. I’m working in C#, and having some trouble. I’ve seen ways to do this with Javascript, but I don’t want to re-write in javascript.
Here is my code. The problem is on line 20. I can’t seem to find the right declaration for the script instance. Any ideas?