|
I have two sets of code. The PlayerCollisions script is suppose to allow for the door on a hut to be opened when four batteries are collected and shown in the gui texture shaped as a battery meter. The script is attached to the FPC with the BatteryCollect on the GUI texture. The problem is that the gui does not show up and the batteries do not disappear and move the meter scale (clearly since it doesn't show up). If someone can look at the PlayerCollisions script and see if you can spot a problem with it, that would be awesome. I'm at a lost and it looks like it's correct and should work, but it does not. PlayerCollision.js
BatteryCollect.js
(comments are locked)
|
|
Haha wow! Thanks, Jaap. The script I had works (except the door opening properly), but just made a simple, in my face error. I forgot to change the tags on the game objects to what they needed to be. Yay! for blonde noob moments XD may i know where to put the batterycollect script? is it attached to the main camera?
Aug 17 '10 at 07:11 AM
nicole
(comments are locked)
|
|
The player doesn't get the OnTriggerEnter event but the battery does. Add a script to the battery with the OnTriggerEnter and let it send a message to the playercontroller, so you'd get something like this: Script to add in battery:
and replace OnTriggerEnter code in PlayerCollision.js with this:
(comments are locked)
|
