How to hold on to and release another sprite

Get help using Construct 2

Post » Sat Nov 10, 2012 8:59 am

I am making a game where I want players to be able to throw a ball to eachother.

I have a player hold on to the ball by (player overlapping ball makes ball position same as player [x=player.x] you get the point).

I tried to make a control to throw the ball. I made condition "keyboard on pressed key" action "set ball angle", "set ball speed" but the ball is just stuck to the player.
B
3
Posts: 2
Reputation: 329

Post » Sat Nov 10, 2012 1:11 pm

Its because even though the speed is trying to make it move, the ball is still overlapping the player meaning it will stay at the position where the player is holding the ball. What you need to do is set the ball out o the players collision polygon and THEN it should be thrown.
B
40
S
12
G
7
Posts: 603
Reputation: 7,656

Post » Sat Nov 10, 2012 1:29 pm

You could use the pin behaviour on the ball.

And activate it when the ball is in contact with the player(s), and deactivate it when it's in the air.
B
18
S
9
G
5
Posts: 77
Reputation: 4,946

Post » Sun Nov 11, 2012 6:01 am

Thanks to both of you. I will try the pin thing out
B
3
Posts: 2
Reputation: 329


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 23 guests