Page 1 of 1
HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 6:35 pm
by JamesTheHedgehog
How come every time i move my character he glitches through a block?
Ive wanted to fix this, but i never can! Please help!
Re: HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 6:57 pm
by DST
This is the oldest and most repeated question on the forums. Try a search for 'collision' in the main search box.
Physical response is ur problem.
Re: HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 7:48 pm
by xr2alex99
buddy
go to collision. then choose your colliding actor.
choose to repeat this event while colliding /the yes no question/
then instead of calculator go to specify. your codes are 1/1/0/1 ok. it works.
Re: HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 7:55 pm
by DST
Lol it works for crap. Making good collisions is a lot more than setting a physical response.
Re: HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 11:07 pm
by JamesTheHedgehog
im still stuck, can you tell it to me in an easier way?
Re: HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 11:22 pm
by DST
there are two ways to do collisions: Physical Response and Collision Free. Both have their advantages.
Physical response waits for a collision between two objects, then moves them outside of each other, while collision free is used to prevent collisions from ever happening.
an example for collision free is
if (CollisionFree("Event Actor", x, y+5))==0{y+=5};
This will cause a player to move down at a speed of five until something is in its way. This method takes some getting used to, but provides much more solid results than physical response.
The best way is a combination of the two. Since gravity must increase as a player falls, the landing spot can be unpredictable. If a player ends up 3 pixels above the platform, the collision free no longer equals zero and the player stops.
So what i do is use collision free for left to right movement, and physical response for up and down movement.
However, the shape of your actor is also a factor. Hey that rhymes.
If your actor's feet move all over the place, its hard to make good collisions. Remember how Mario was always a solid block, in a way? his feet were flat. that's very important. I am going to release a demo later today showing a good collision method.
Re: HELP! Character Glitches through blocks!
Posted:
Wed Jun 18, 2008 11:35 pm
by JamesTheHedgehog
sorry if im getting annoying, Can you tell me EXACTLY what i do?
Like what i should put down for text, Im kinda new, and im clueless...
Re: HELP! Character Glitches through blocks!
Posted:
Thu Jun 19, 2008 1:34 am
by feral
JamesTheHedgehog wrote:sorry if im getting annoying, Can you tell me EXACTLY what i do?
Like what i should put down for text, Im kinda new, and im clueless...
try this demo it is very basic and only has what you need so should be easy to follow
viewtopic.php?f=6&t=5768feral