vector - Drag and throw in Unity3D -


so, i'm developing game pretty bowling in unity3d.

the user has pickup object , throw it, in bowling. user has limited area throw it.

my question is: how calculate vector apply in rigidbody? read in question have subtract atualposition lastposition vector. , it. but, how lastposition? mean, user sliding gameobject 1 spot until decides throw it. can verify mean in glow hockey game:

https://play.google.com/store/apps/details?id=com.natenai.glowhockey

https://itunes.apple.com/pt/app/glow-hockey-2-free/id346453382?mt=8

and pretty i'm trying do.

are developing mobile game, i.e. have touch input or mouse input?

you need gesture recognizer. can write 1 , track touch/mouse position last frame , interpret cursor movement. want interpret whether user has made drag or swipe gesture , use add forces gameobjects.

there gesture interpreters available in asset store. search "gestures" or "touch gestures" there: https://www.assetstore.unity3d.com/#/search/gestures%20touch


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -