[Solved] How do I get animation to face correct direction?

Get help using Construct 2

Post » Sun Mar 29, 2015 10:18 pm

See the code below. No matter what variations of the arrow and/or angle settings I try, I cannot get the arrow to face toward the target. It moves toward the target as it should however the Thor damn arrow is always facing backwards. Yes, I tried arrow.SetAngle on both "Yes" and "No". Doesn't matter.

I just do not and cannot understand what I'm doing wrong :(

Image
Last edited by locohost on Sun Mar 29, 2015 11:38 pm, edited 1 time in total.
B
13
S
4
Posts: 280
Reputation: 1,566

Post » Sun Mar 29, 2015 10:23 pm

set arrow.bullet.angleofmotion to angle(arrow.X,arrow.Y,target.X,target.Y)


And the bullet behavior need to have rotate object on
Who dares wins
B
50
S
10
G
10
Posts: 1,728
Reputation: 12,866

Post » Sun Mar 29, 2015 11:05 pm

lennaert wrote:set arrow.bullet.angleofmotion to angle(arrow.X,arrow.Y,target.X,target.Y)

And the bullet behavior need to have rotate object on


You described the settings exactly as they are. You can see the bullet.angleOfMotion in the code above. I have bullt.SetAngle property set to "yes". Token.X/Y are the target coords.

The arrow moves correctly from shooter toward target. That part works, but the arrow animation is always facing exactly opposite regardless of shooting from left to right or right to left. Always backwards.
Last edited by locohost on Sun Mar 29, 2015 11:10 pm, edited 1 time in total.
B
13
S
4
Posts: 280
Reputation: 1,566

Post » Sun Mar 29, 2015 11:32 pm

I fixed it. The problem was the original animation was not facing right. It seems all of the C2 code expects the starting position to be facing right. I guess :?

It works now.

Thanks again @lennaert
B
13
S
4
Posts: 280
Reputation: 1,566


Return to How do I....?

Who is online

Users browsing this forum: a1oleg and 16 guests