# how to trow a object to a image point?

### » Tue May 03, 2011 4:25 pm

[quote:2jfe552q] You can do it with one event with the physics behavior. Change the PV 't' to change how long in seconds it takes to get to the target.
http://dl.dropbox.com/u/5426011/example ... ctile2.cap made in 0.99.97 [/quote:2jfe552q]

Thanks ROJOhound, this is really what I need, a conctruct expample

It's awesome how you do that with only 1 event, don't understand either the logic of this formule but thats more because my low mathematic skills.

Thanks again for this example
B
43
S
8
G
5
Posts: 110
Reputation: 3,605

### » Wed May 04, 2011 5:23 am

[quote="R0J0hound":rj9ael96]You can do it with one event with the physics behavior. Change the PV 't' to change how long in seconds it takes to get to the target.

Hey Rojohound,

That .cap is great. I've never used the Physics behavior in Consruct before and I was wondering... is there a way to make the thrown object move to another object the same way as your example, but instead by using a single 360 button or PC keyboard command instead of using the mouse to set an angle?

For example: I press 'A' on the 360 controller and the ball arcs to object A. I press 'B' and the ball arcs to object B, and so on and so forth.

I've been able to activate the ball movement based on a mouse left click and set the ball's angle to the position of the target, but I'm having trouble changing the expression in the velocity equation to do what my example above describes.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

### » Wed May 04, 2011 10:34 am

The mouse isn't setting the angle, it's setting the target (or the location to arc to).
To target a different object just replace "mousex" and "mousey" with the object's x and y.
B
82
S
26
G
62
Posts: 4,830
Reputation: 45,200

### » Wed May 04, 2011 5:28 pm

[quote="R0J0hound":2dwc8kfi]The mouse isn't setting the angle, it's setting the target (or the location to arc to).[/quote:2dwc8kfi]

Right. My mistake, I meant to say arc.

[quote="R0J0hound":2dwc8kfi]To target a different object just replace "mousex" and "mousey" with the object's x and y.[/quote:2dwc8kfi]

The expression is where I'm stuck. I want to be able to throw the object with a controller button and have the arc's size only be based on how far the distance the ball being thrown is from the object being thrown to. For example:

01 ======= 02

^^^
The 01 represents the object the ball is being thrown from. 02 represents the object that will catch the ball. Because the distance is short the arc will be short.

01 ============================================= 02

^^^ In this one, since the distance is longer the arc will be higher.

Here is all I was able to get up to:

B
12
S
4
G
3
Posts: 426
Reputation: 2,458

### » Thu May 12, 2011 4:51 pm

How could it (arc throwing) be done without physics, as the example doesn't work in the latest C build.
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

### » Thu May 12, 2011 7:26 pm

It works with the latest if you also get lucid's physics fix (in the same thread) and uncheck and check "Use old units".

You can also do it with just events:
http://dl.dropbox.com/u/5426011/example ... ctile1.cap
B
82
S
26
G
62
Posts: 4,830
Reputation: 45,200

### » Fri May 13, 2011 3:13 am

[quote="R0J0hound":3kmtcdq1]The mouse isn't setting the angle, it's setting the target (or the location to arc to).
To target a different object just replace "mousex" and "mousey" with the object's x and y.[/quote:3kmtcdq1]

This worked with your newest example, but for some reason it won't respond in the physics example you posted.
B
12
S
4
G
3
Posts: 426
Reputation: 2,458

### » Fri May 13, 2011 7:56 am

[quote="R0J0hound":1sr97hvv]It works with the latest if you also get lucid's physics fix (in the same thread) and uncheck and check "Use old units".

You can also do it with just events:
http://dl.dropbox.com/u/5426011/example ... ctile1.cap[/quote:1sr97hvv]

That's it, I didn't uncheck the Use old units box. I used the ball behavior eventually, but it could be useful somewhere else and I can see what I've made wrong when I tried to made it myself, thanks for the example.
B
25
S
6
G
8
Posts: 773
Reputation: 6,643

### » Fri May 13, 2011 8:16 am

Could fake the throw arc with cosine or cubic interpolation?
B
62
S
21
G
12
Posts: 1,910
Reputation: 13,155

Previous