#Help pls
1 messages · Page 1 of 1 (latest)
i have a flashlight battery system for when i use the flashlight the battery losse intensity until he dont have any intensity but i decided to try create a script for when pick a battery my flashlight recharge the flashlight intensity
but dont work
flashlight loss intensity with time script
pick battery based on the flashlight script
but whats realy it matters
is the finish of the script
after the "batteryPercentage = Mathf.Clamp(batteryPercentage, 0, 100);" line
and i enter in the hitbox of the battery but dont add battery percentage for my falshlight
or intensity
You need some sort of OnTriggerEnter method to actually call pickup
oh, oops
Make sure the battery has a collider, and it's set to "IsTrigger"
Player also needs a rigidbody. Add a debug.log to the beginning of OnTriggerEnter to make sure it's actually running
yes he have a box collider and ok i gona set
and he have a rigidbody and ok i gona add
i ad the Debug.Log before or after the void ?
Yeah if that's your question, this is way too advanced for you
sorry if i am starter, but i need this script i am mading a terror game
You need to learn some basic C# to get it going then
i have the same problem
i need a script for battery pick up system
but the what i have dont work
i try to put the Istrigger and the debug but this gime so much errors
What kind of errors?
i dont now i doo right but probrably not
syntax error
and name other don thave context
and private dont is valid
Ok that is really not valid
You cannot Debug.Log there at all ever
And your issue is you put IsTriggerEnter, the callback is called OnTriggerEnter
but jon tell me to put Istriggerenter and no Ontrigger
Don't lie to me
He told you to mark the Collider component on the GameObject in the Scene as IsTrigger
He did not tell you to write IsTriggerEnter
Does it work now after the changes I asked for?
but what changes you asked bro
you dont asked to i doo any changes
cotinue dont working
Let me make one thing very clear, you are testing my patience
Two things, do them
Remove the stupid Debug.Log, which is never valid in it's current location
And fix the method name
sorry I'm sleepy
i remove the debuger
I hear that all the time, if you think your lack of sleep is impeding your ability, you should rest
but i wana only finish this script
Then do the changes I mentioned