Hye there i m making a simple Shooting Game but its not like FPS(First Person) shooting game…
it is simple 2d (Mobile game) where if we touch anywhere on screen player aim at that point and a Aiming arrow is also appear and when we release it shoots the bullet…
i know I can make that with the help of OnPointerDown , OnDrag , OnPointerUp function but because i m beginer i cant code that properly i tried but failed every time…
and one more thing bullet has rigidbody so we only have to addfore in the direction of pointer released plz helpme out…
if there is any Video Tutorial availabe similar to my Problem then plz send me link…
i will be thankfull n appricate u in advance for my help
u can Better understand with photos that i attached what i m trying to do…
when the user presses the screen, store the position firstPressLocation
when the user releases the finger store lastPressLocation and do the following:
calculate the velocity by vel = (lastPressLocation-firstPressLocation).normalized * speed
Improving it so a small drag fires less would be to also multiply it by screen height or other fixed factor. Personally, I use units and never go into screen space so I would have converted the touch into world space first for resolution independence.
sorry to disappoint you, but you asked twice about video tutorial - nowhere did you mention that you have already watched that very same official tutorial video. So I provided it. I don’t have any other tutorial for you however.
yup n i m thinking to make videos on all that type of thing n upload on You Tube for the beginers like me to help them out with the help of unity and there great priceless helps
Did you able to get through this. I am also a beginner and i am trying do the same thing. please share any video or information do you have it will be great help from you