• 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!

[Solved!] Collision mask to be changed

Hi there!

I`m still in final works of my game.
I remarked a simple, but annoying problem:

My jump`N`running idle does everything he should.
So far so good. But if I duck, he goes down on ground,
to dodge incoming enemies. But because of a line
in the code within my Player-object, the ducked idle
(a called sprite_index) still has the collision mask of
the main-idle (stand, run, jump) of the Player-object.

How could I change the duck-idle´s collision mask, fitting
to his flat position?

If I press vk_down, he ducks. That code is in step event
of the main object of the player idle. The ducking sprite
is called via simple if down-key is pressed... sprite_index = sPlayerDuck.
The own collision mask of the sprite doesn´t work, but the
collision mask of the player object.

Any idea?

Best wishes,
Archie.
 

TsukaYuriko

☄️
Forum Staff
Moderator
When changing the sprite, change the collision mask as well. Not doing so literally instructs the instance to continue using the instance-wide defined mask. The currently assigned mask is stored in mask_index.
 
When changing the sprite, change the collision mask as well. Not doing so literally instructs the instance to continue using the instance-wide defined mask. The currently assigned mask is stored in mask_index.
It works! Of course! :rolleyes: Domo arigato!

Greetings. Archie!
 
Top