Collision Event not working

D

David Fink

Guest
I made a collision event with another objcet but it doesnt work. The strange thing is that it does work with place_meeting.

Working: http://prntscr.com/m6rclg
Not working: http://prntscr.com/m6rcqi

The o_hitbox contains a sprite with the standard collision mask, and the collision event is on the enemy and i want it to collide with the hitbox object.
 

samspade

Member
I made a collision event with another objcet but it doesnt work. The strange thing is that it does work with place_meeting.

Working: http://prntscr.com/m6rclg
Not working: http://prntscr.com/m6rcqi

The o_hitbox contains a sprite with the standard collision mask, and the collision event is on the enemy and i want it to collide with the hitbox object.
You should post code using code tags instead of images. (Its technically forum rules).

How are you moving your objects? Nothing immediately comes to mind except this post: https://forum.yoyogames.com/index.p...ject-go-through-each-other.57299/#post-346843

Short, version, having a collision event (according to this post which I didn't test) automatically makes an object solid. Which, depending upon whether you're using other variables, might mess things up.

Otherwise, some of the other things in this post might be helpful to try.
 
D

David Fink

Guest
You should post code using code tags instead of images. (Its technically forum rules).

How are you moving your objects? Nothing immediately comes to mind except this post: https://forum.yoyogames.com/index.p...ject-go-through-each-other.57299/#post-346843

Short, version, having a collision event (according to this post which I didn't test) automatically makes an object solid. Which, depending upon whether you're using other variables, might mess things up.

Otherwise, some of the other things in this post might be helpful to try.
Ok im trying to give you a better view over my project.

Im creating the hitbox in a certain event:

Code:
var hitbox = instance_create_layer(x, y, "Instances", obj_hitbox);
And on the obj_hitbox i have the sprite that gets spawned and i have a collision check with the enemy's object witch is, as i already said, not working. But when i write the place_meeting code in a Step Event it is working, why?

Edit: I just checked the post you linked and wanted to add that the obj_hitbox is not moving and has only got a lifespan of 4 frames.
 
Top