Animation and rotation question

Get help using Construct 2

Post » Tue Jul 29, 2014 7:20 pm

Is there a way to display the sprite's animation in such a way that it stays facing one direction, independent of the sprite's angle variable? My MOB's AI uses the sprite angle a lot, but if I do 3/4 view I need the sprites to remain standing "upright" and not flip all over when changing direction.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Wed Jul 30, 2014 2:01 am

are you just needing to add "set flipped" and/or "set mirrored" when they change direction? or is it more complicated than that?
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Wed Jul 30, 2014 2:23 am

Why don't you add instance variables that states different conditions for different animations ? Then add another condition to strict the direction of your sprite must facing to.
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Wed Jul 30, 2014 1:09 pm

@spacedoubt That would be the next step if I could get the sprite image/animation to not rotate in the first place. @alextro I am not sure what you mean. How would another variable straighten out the direction of sprite facing?
I could solve this problem by making my sprite invisible, and pinning another sprite to to it with the proper graphics, and setting the pin options to "position only". But that would be an inelegant solution that adds more complexity to an already complex entity. At least it should give you a better idea what I'm asking though.
B
11
S
4
G
1
Posts: 159
Reputation: 1,803

Post » Thu Jul 31, 2014 11:42 pm

Well, what is the sprite's angle variable for, if not to change the sprite's angle? is there an angle of motion involved? I'm not quite clear on what exactly you're trying to do.. maybe try changing the "set angle" on whatever you're using to make them move.
B
86
S
43
G
71
Posts: 601
Reputation: 43,619

Post » Fri Aug 01, 2014 11:16 am

maybe this is what you want to achieve
You do not have the required permissions to view the files attached to this post.
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Fri Aug 01, 2014 2:48 pm

It sounds to me like you want the sprite to face one direction with is angle variable, which is independent of the direction that it is moving. You can do this, it depends on how you're moving the sprite.

For example, if you're using the 8 direction behavior, one of the properties is "set angle" This has the options to set the angle of the sprite to the angle it is moving, to round the angle off to the nearest 90 or 45 degrees, or to not set the angle of the sprite depending on which direction it is moving. So what you would want is "Set angle: No"
B
11
S
3
G
1
Posts: 98
Reputation: 1,062

Post » Fri Aug 01, 2014 2:53 pm

If I got what you want, you should just use one invisible object for the logic (AI) and another one with the graphics pinned above it, for position only, this way the angle won't change.
Please tag me with @caiorosisca if your post is refering to me :). I don't always follow the topics I answer.
B
11
S
4
G
1
Posts: 272
Reputation: 1,643

Post » Fri Aug 01, 2014 3:11 pm

@Robsta
That is exactly what I did on my example "Set angle: No". This kind animation setup suits high angle view
ImageImage
B
105
S
46
G
23
Posts: 778
Reputation: 22,226

Post » Fri Aug 01, 2014 8:32 pm

@alextro oh cool. I wasn't able to view your .capx because you're using the beta version (I'm using latest stable version), so I had to guess what you did there.
B
11
S
3
G
1
Posts: 98
Reputation: 1,062

Next

Return to How do I....?

Who is online

Users browsing this forum: unxcellent and 4 guests