[Solved] Stop "set angle twoard" from rotating

Get help using Construct 2

Post » Fri Apr 05, 2013 10:55 pm

https://dl.dropbox.com/u/44684026/scirra/Pinky.capx


Is there any way I can stop Pinky from rotating when just using this default movement?
Crazeh2013-04-06 01:41:35
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327

Post » Fri Apr 05, 2013 11:22 pm

Can you share what behavior you're using? It's nice that you provided a .capx but it seems like the description has little to no details.

If using bullet behavior, the object will rotate with the angle.

If using CustomMovement behavior, the object will not.
Project Lead of Zems Online Card Game

Producer at Impulse Limited
B
18
S
6
G
3
Posts: 677
Reputation: 5,194

Post » Fri Apr 05, 2013 11:34 pm

Default movement.

http://i.imgur.com/tZ4dyTC.jpg

As you can see here, everything is working, except that she should ofc preferably not be rotating when chasing the "player".

http://azylet.com/PinkyCrazeh2013-04-05 23:35:02
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327

Post » Sat Apr 06, 2013 12:20 am

Instead of 'set angl'e and 'move forward', use 'move at angle'.

pinky.capx
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Sat Apr 06, 2013 12:26 am

If you select Pinky or whatever object you gave the movement behavior to (like a sprite bounding box, maybe) the behavior settings should show up in the properties sidebar. Look for "Set Angle". The default selection for it should be "360 Degree", so change it to "No".
Hope that helps.

EDIT: Nevermind, listen to ramones.Ahr Ech2013-04-06 00:50:58
B
23
S
7
G
3
Posts: 180
Reputation: 4,064

Post » Sat Apr 06, 2013 12:28 am

To Ramones: That stops the rotating, but it also stops the animations working correctly as it's not picking up on the direction it's moving. :(


ahr ech:

The 360 degrees works in 8 direction movement, but I can't find an equivalent in the default movement where no behavior is set. I can make f.ex a path npc move around in the same'ish way, but for chasing i prefer this movement type. While i Could just place an animation sprite on top of the box to make it not matter if the box under it spins, this posed some issues with random spawning mobs which I was hoping to solve with this super simple chase method. And it was looking sooo great, until I hit this rotating bump in the road.
Crazeh2013-04-06 00:33:24
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327

Post » Sat Apr 06, 2013 12:44 am

Ah yeah I wasn't paying attention. You can store the moving angle in a variable and use that to pick the correct animation. I updated that capx.

A better solution would be to use bullet behavior on Pinky. You can set the image angle and the moving angle separately.

*edit* the angle would be between -180 and 180 if you do it this way.
*edit2* pinky_bullet.capxramones2013-04-06 00:58:05
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Sat Apr 06, 2013 1:11 am

ramones: That did it :) Tho a bit buggy, need to figure out why her "up" animation is not working with this setup now..


Oh joy, more numbers!
My absolute weak point is numbers, they mess with my head..
This may be simple to most people, but I can count on two hands the amount of math classes I attended in school over the last 6 years when I was in school, and that's some time ago...


Had a Lot of fun during last night figuring out the logic degrees for 8'way movement, especially fun when you have never owned a protractor and don't have a clue if it's 10, 0 , -10 or 10, 0 , -180 etc >.< Took me forever just to remember the Norwegian name of the protractor so I'd be able to google it..

A previous project with 4-way movement demanded 0, 90, 180, -90. So it took a while before I thought of trying 0, 360 on this one >.<

Thank you for the help tho, will start looking in to it.. :)
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327

Post » Sat Apr 06, 2013 1:18 am

[QUOTE=ramones]
*edit2* https://dl.dropbox.com/u/8367729/construct/example/pinky_bullet.capx[/QUOTE]

Thank you thank you thank you!!! :) bullet works lovely. Set the animations to loop and it's working great. Can finally start working on the next parts! :) Thank you.
-- Because a pig told me to be nice.
B
11
S
2
G
1
Posts: 29
Reputation: 1,327


Return to How do I....?

Who is online

Users browsing this forum: jeffige and 23 guests