no collision with block?

5 replies to this topic

#1 KuzTum

KuzTum

GMC Member

• New Member
• 7 posts
• Version:GM8

Posted 01 May 2012 - 02:49 AM

for some reason my character wont collide with the ground, im not sure why, im helpless at game maker so i don't know how to fix it all i can tell you is that i have some sort of gravity on it, i took it from a freinds game that was almost completely different to mine beacuse i didnt know how to make gravity work. im sorry if i sound stupid, but i really am stuck.
• 0

#2 creators124

creators124

awesomeliciousmember

• GMC Member
• 866 posts
• Version:GM8

Posted 01 May 2012 - 03:18 AM

for some reason my character wont collide with the ground, im not sure why, im helpless at game maker so i don't know how to fix it all i can tell you is that i have some sort of gravity on it, i took it from a freinds game that was almost completely different to mine beacuse i didnt know how to make gravity work. im sorry if i sound stupid, but i really am stuck.

I need more than your personal life.
ok?
• 0

#3 KevinBlazeCoolerz

KevinBlazeCoolerz

GMC Member

• GMC Member
• 111 posts
• Version:GM8

Posted 01 May 2012 - 12:34 PM

just check the Solid in obj_block
• 0

#4 KuzTum

KuzTum

GMC Member

• New Member
• 7 posts
• Version:GM8

Posted 02 May 2012 - 01:07 AM

just check the Solid in obj_block

it is :\
• 0

#5 kremling

kremling

GMC Member

• GMC Member
• 146 posts

Posted 02 May 2012 - 05:50 AM

There are many ways to eliminate this problem, but you need to explain your current method. First of all, it is better to have solids checked 'off' and NOT 'on.' Having a manual collision you can actually control is much better than relying on Game Maker to do exactly what you want. I check my collisions by using the 'collision_rectangle()' function. The function returns the object that was found in the boundaries of the rectangle. For example...

collision_rectangle(bbox_right+1,bbox_top,bbox_right+1,bbox_bottom,objsolid,1,1) would check for collisions one pixel to the right of the calling object's bounding box.
• 0

#6 GStick

GStick

All Secrets Exposed

• GMC Member
• 1580 posts
• Version:GM:Studio

Posted 02 May 2012 - 06:37 AM

Though, if you want to use the calling object's bounding box in a collision check, and not an arbitrary rectangle boundary...

```// check for a collision with objsolid 1 pixel to the right
if (instance_place(x + 1, y, objsolid) != noone)
{
// a collision occurred
}
else
{
// no collision
}
```

... would be a better choice than collision_rectangle.
• 0

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users