RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[GM] Help - Character Movement Animation

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 87
Kotae Wa Kitte Nai...ii?
I have already made an object for my character, it has basic movement of left and right now. I have made it to change sprite for the appropriate direction. Now, my problem is, how do I make it change to a my walking sprites while walking and change back to the normal sprite when stopped. I have 8 sprites for walking. Any help is greatly appreciated.

Regards
~Shibuya
« Last Edit: March 04, 2014, 01:41:36 AM by modern algebra »
Dude do you break dance?

**
Rep:
Level 88
I'm scared of my grandma. Wouldn't you be?
Making it change when walking:

When left or right are held, make the sprite change to the walking ones and set variable:  image_speed  to a number that you think looks good.

Making it change to standing sprite upon stopping:

Make an action for left and right released and change the sprite back and set  image_speed to 0 (or a different number if your stand is animated)

Sorry to make you wait, hope this helps. I'll be able to help more if you need anything else.

**
Rep:
Level 86
Do you prefer code or D/D (Drag and Drop)? If you ask me, GML is easier than Drag and Drop but then ..

An example is ..

Code: [Select]
//Press Left Key

sprite_index=spr_RunL

Code: [Select]
//Release Left Key

sprite_index=spr_Stand

Code: [Select]
//Press Right Key

sprite_index=spr_RunR

Code: [Select]
//Release Right Key

sprite_index=spr_Stand


Yeah, you'll need a bit of tweaking to get the code to work properly with your game. It's simple and I know there are some flaws, but it should still be useful.