Jump to content

Detect time passed in UpdatePhysics()


YouGroove
 Share

Recommended Posts

Well

In fact i want to have some PC first game using super simple mouse move detection :

Mouse Click and keep clicked, mouse move in a direction, Mouse release

 

How to detect the time passed between a click and a click release ?

How to manage that in UpdatePhysics() loop ?

Any idea ?

Stop toying and make games

Link to comment
Share on other sites

Thanks, i should had read the docs, didn't think it could be easy :

Time.getCurrent() or Millis() save in in some variable when mouseDown

Than call again getCurrent on mouseUp than just calculate the difference between the two variables to have some time ellapsed.

  • Upvote 1

Stop toying and make games

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...