Mawz
1
Hey,
so i am trying to create a time that starts when i hold my firing button down and then counts down when i release the button.
im not looking for exact code im just looking for a place to start looking at?
according to my gues it has to do with Time.time and setting it equal to some variable
but i am probably wrong so i would appreciate some help thank you all for your time.
fafase
2
ok so no code just pseudo code
if button is held down then start counter
temp counter += deltaTime
else if button is up then stop temp counter is assign to counter and back to 0
So you need Input.GetMouseButton that returns true as long as you press.
Then Input.GetMouseButtonUp returns true when you release the button
other way is
if button is down then start counter
start counter= time
else if button is up then stop counter = time
total = stop counter - start counter;
this time you use GetMouseButtonDown and GetMouseButtonUp