• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GML Visual Set Sprite Question

R

RDTJ

Guest
Hello,

I am new to GSM2 and to game dev in general. I know this is a super simple question but I'm hoping someone can help me out. I'm trying to get my sprite to change into a different animated sprite when moving or jumping. I am using drag n drop. Let's take right movement (platformer) for example:

I created an event for 'key down right', added 'set speed' to it, added 'set sprite' to it, and added 'set friction'.

When I test this the newly changed sprite loads towards the bottom of the game, not where my current player sprite was.

Any help is appreciated! :)
 

Binsk

Member
You are using this action, correct?

Is the sprite you are setting it to roughly the same size as the one you are switching from? Are their origin points in the same spot (you can check by opening the sprite editor in GameMaker)?

If you remove the "set sprite" action does the problem go away or does the object still show up near the bottom?
 
Last edited:

Slyddar

Member
As mentioned, sounds like the origin of the sprite was left at the top left. Change it in the sprite properties to ensure it's the same as the other sprite.

Also if you are starting out in drag and drop, you can try my Youtube series, as I show how to do sprite changes in there, among other things.
 
R

RDTJ

Guest
As mentioned, sounds like the origin of the sprite was left at the top left. Change it in the sprite properties to ensure it's the same as the other sprite.

Also if you are starting out in drag and drop, you can try my Youtube series, as I show how to do sprite changes in there, among other things.
I'd be happy to try out your tutorials, thank you for the offer. Do you have a link to one about setting/changing sprites?
 
R

RDTJ

Guest
You are using this action, correct?

Is the sprite you are setting it to roughly the same size as the one you are switching from? Are their origin points in the same spot (you can check by opening the sprite editor in GameMaker)?

If you remove the "set sprite" action does the problem go away or does the object still show up near the bottom?
Sprites are the same size, and I believe I just found a solve. I sort of went at the inputs in a different manner and it seems to be solved! :D
 
Top