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

Legacy GM Collisions and collectibles not working

W

Whittick

Guest
Help - collisions stopped working when I upgraded
I am using Gamemaker Studio (mainly drag and drop) - we recently upgraded to studio - and in the latest update object such as coins no longer have the same collision - the player has to jump on the object to collect it - whereas before the collision worked perfectly Mario style - running into the collectible.

Hero obj is solid
collectible is not

have tried making both or none solid
have altered depth, masks, sprites
have added variable score and added code

score+=1
with other instance_destroy()

In the collision instead of just dragging the instruction in

Bullets (also non-solid) are now appearing to be solid - hero is now impeded by a bullet fired when running - code for hero below

Information about object: ob_hero
Sprite: righthero
Solid: true
Visible: true
Depth: 0
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
set the score to 0
set the number of lives to 3
set variable sptite_index to righthero
Step Event:
execute code:

if place_free(x,y+1) {gravity=0.5 gravity_direction=270}else{gravity=0}

Collision Event with object ob_wall:
execute code:

if vspeed>0 && !place_free(x,y+vspeed) {move_contact(270)}vspeed=0

Collision Event with object ob_food:
execute code:

score+=1
with other instance_destroy()

if number of objects ob_food is equal to 0
display message: Level up
Go to next room



Keyboard Event for <Left> Key:
if relative position (-3,0) gives not a collision with Only solid objects
jump relative to position (-3,0)
Keyboard Event for <Up> Key:
if relative position (0,+1) gives a collision with Only solid objects
set the vertical speed relative to -9
Keyboard Event for <Right> Key:
if relative position (3,0) gives not a collision with Only solid objects
jump relative to position (3,0)
Key Press Event for <Space> Key:
if sprite_index is equal to righthero
create instance of object obj_bullet at relative position (16,16) with speed 8 in direction 0
if sprite_index is equal to lefthero
create instance of object obj_bullet at relative position (16,16) with speed 8 in direction 180
Key Press Event for <Left> Key:
set the sprite to lefthero with subimage 0 and speed 1
Key Press Event for <Right> Key:
set the sprite to righthero with subimage 0 and speed 1
 

jo-thijs

Member
Hi and welcome to the GMC!

The object information you posted doesn't contain enough information yet to tell what is causing the issue.
Can you also give the object information of the collectible object?
And can you also give the mask properties of the sprites of ob_hero and the collectible object?
 
W

Whittick

Guest
I have altered the masks on both several times - so they are now rectangle - full image

Information about object: ob_food

Sprite: food
Solid: false
Visible: true
Depth: 100
Persistent: false
Parent:
Children:
Mask:
No Physics Object

I added this too - just in case

Collision Event with object ob_hero:
execute code:

with self instance_destroy()
 
W

Whittick

Guest
Only if the hero object drops on it from above - cannot do it by moving horizontally into the object
 

jo-thijs

Member
Can you temporarily upload the gmz file (File > Exprot Project) somewhere (mediafire, onedrive, dropbox, google drive, box, ...) and share the link?
I understand if you don't want to, but it would make helping easier and faster.
 
W

Whittick

Guest
Sorry to be so needy - how would I replave the check collision with check empty - have just tried what I thought would work and no joy
 

jo-thijs

Member
The check empty action does exactly what the check collision action does,
only the check empty action has its "NOT" checkbox checked if and only if the check collision action doesn't have it checked.
 
Top