x


Advice sought after: Creating a suitable 3D flick script

Hi, I have read through many flick scripts and am currently stumped on how I should proceed with my case.

The iPhone Flick Shooting is a good reference but not sufficient.

Building for the iOS: I have a GameObject, Let's call it Frisbee. The camera is positioned on an inclined angle above it. (somewhat a 3rd person view) I have to throw the frisbee in this angled view.

Touch begins on the frisbee (not relative), and when touch phase is ended, the end position determines the angle of the frisbee's direction to move towards and the magnitude of the move.

A visual indicator (arrow) will indicate the dorection of throw, so the angle has to be captured in 3D space. (i.e. I can't use 2D touch positions)

I thought of using raycast but am not sure if that is the best way to do it.

I am thinking of using Constant Force and adjusting the relative force z based on the magnitude. However I am not sure how i can return the angle of the direction to throw towards.

Humbly seeking advice. Thanks

more ▼

asked Nov 26 '10 at 06:23 AM

EternaSky gravatar image

EternaSky
11 1 1 6

The description gets a bit confusing about the arrow+angle. Could you perhaps rephrase? Including the code you're using might help. You touch the Frisbee from your 3/4 angle or what have you, move your touch and release. The speed is determined by the distance moved and the duration of the touch. You say, "the end position determines the angle of the Frisbee's direction..." but how exactly do you intend that to work? In your 3/4 view, the angle of your touch movement on the screen is going to be angled towards the ground or sky, but did you want this sort of angle to the movement?

Nov 26 '10 at 05:17 PM skovacs1

You need a vertical and horizontal direction, but how did you want the movement in your 3/4 view to relate to these? If you want it 1:1 camera relative, you would simply generate your direction from the camera's Transform.

Nov 26 '10 at 05:20 PM skovacs1

As far as the force to use, the solution you present doesn't feel like it is the correct approach. What happens when a Frisbee is thrown is that it moves with force in the relative forward direction (not constant) (release velocity) and the rotation of the forward angle is adjusted based on the curvature of the throw (centripetal force) + lift - wind resistance, etc. So you actually have two directions to worry about, the release direction and the direction of the centripetal force +/- drag and lift.

Nov 26 '10 at 05:32 PM skovacs1

Thanks for replying.

I'm sorry if I was confusing. I am thinking of how to better explain this. the frisbee is just an example. the actual is just a sliding disc on a flat plane/level design.

When moved, the disc follows along the floor.

That said, the control is meant to allow the finger to touch the disc, and then flick it towards a direction, the disc then follows towards the direction of the flick.

The camera is positioned above the disc, pulled back and looking onto it. (somewhat looking over the shoulder)

Nov 27 '10 at 01:16 PM EternaSky
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Sorry to bump this but searching this was the only thread I could find that came close to answering what I'm after. Also I couldn't work out how to PM the original poster.

Does anyone have a sample script of this sort of "Flick Control" system? I am working on a couple of games where this would be the best control option for the use.

more ▼

answered Sep 02 '11 at 11:59 PM

Makipae gravatar image

Makipae
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2021
x606
x300
x10

asked: Nov 26 '10 at 06:23 AM

Seen: 1536 times

Last Updated: Sep 02 '11 at 11:59 PM