Page 1 of 1

help!! help!! "Gravity problems" help!! help!!

PostPosted: Tue Jan 23, 2007 11:39 am
by Fl3tch
i have set gravity up using the tutorial on the ge program but i am still having a problem when my character is on a different platform to the floor. when trying to run off of the platform the gravity wont make me fall to the floor untill i have released the directional button that i am using, he will just glide across the air. obviously i would like him to fall immediately after leaving the edge of the platform no matter what direction i am moving and what button i am pressing (left or right).

anouther thing: when running along the floor i can not jump unless i stand still, i cant jump while running so this will prove a problem when i need to jump over a gap or hole in the floor. also if i try and move to the side after jumping on the spot i will not fall while goin that direction i will move in a straight line untill i let go.

please give me help as i need this problem solved to complete my game.
any help will be gratefull
thanks
fletch

PostPosted: Thu Jan 25, 2007 10:54 pm
by Fl3tch
does no1 know the answer!! lol

help please :)

PostPosted: Fri Jan 26, 2007 12:30 am
by Game A Gogo
well, could you send a the .ged and the data folder, i could help you^^

PostPosted: Fri Jan 26, 2007 9:52 pm
by Troodon
What's your xvelocity and yvelocity? Because if you go very quickly to x direction the y will effect less.
Game a gogo (or someone else who has the latest GE) will help you when you send the ged-file, but in the meantime try to make the fall accelerate.
For example
yvelocity = yvelocity + 1;

Then disable the moving in right and left when you don't touch the ground. For example with a variable called canMove.
When canMove is 0, you can't move and when it's 1 you can.
Collision any side of ground = canMove 1
end collision with ground = canMove 0

I hope this helped. :)

PostPosted: Sun Jan 28, 2007 11:23 pm
by Fl3tch
thankyou, i will give this a try and will get back to you to tell you how it goes.
thanks

PostPosted: Wed Jan 31, 2007 10:09 am
by Fl3tch
still having problems :(
i tried changing the x and y velocity like you said but that didnt make any noticeable difference. can you explain about the can move 1 and can move 0 im not to sure what you mean or where that should go.

does anyone have any other ideas? i cant still walk in mid air if i try and walk half way through a jump.

i am not using the actuall version of ge yet so i can not send the file, i am doing this for a course at college and my teacher hasnt purchased the program yet. This wouldnt be the reason would it?

would seem like a program with my coding but i have checked everything over several times and there is nothing wrong.( i set it up using ge gravity tutorial)

more help please!!
:shock: :? :(

PostPosted: Wed Jan 31, 2007 10:11 am
by Fl3tch
few typos there :/:/:/

"" can still walk in mid air if i try and walk half way through a jump. ""


"" would seem like a problem with my coding but i have checked everything over several times and there is nothing wrong.( i set it up using ge gravity tutorial) ""

thanks

PostPosted: Wed Jan 31, 2007 2:57 pm
by Troodon
Make a variable called canMove.
Write in the draw actor:
Code: Select all
if (canMove == 0)
{
EventDisable("Event Actor", EVENTKEYDOWN);
}

if (canMove == 1)
{
EventEnable("Event Actor", EVENTKEYDOWN);
}

Then write in collision finish with ground:
Code: Select all
canMove = 0;

And in collision any side of ground:
Code: Select all
canMove = 1;


I hope this helped.

PostPosted: Wed Jan 31, 2007 8:09 pm
by mr-game
just right click the character and go onto actor control then click the add event thing and pick draw actor
then pick script editor and put
yvelocity = yvelocity + .5;
and choose immediate action.
then that actor shoudl fall where ever u havnt put in on a platfrom with a physical responce hope this helped
hope im not like talking about somthign that none els here ways if i am sorry :)

PostPosted: Fri Feb 02, 2007 9:30 am
by Fl3tch
cheers mr game, this is the same as the tutorial advice though, so it hasnt worked im afraid :(.

tekdino, i have tried this but it wont recognise the canmove (undeclared indetifier) am i doing something wrong. and also not tosure where to put the collison code u mentioned.

cheers

PostPosted: Fri Feb 02, 2007 2:39 pm
by Troodon
You should create the variable in the script editor. Click on the variables button. :)

PostPosted: Mon Mar 05, 2007 2:57 am
by Westside Rep
What if you want to STAY on the ground, never leaving it?

PostPosted: Mon Mar 05, 2007 5:12 am
by DilloDude
It seems unusual that the sideways movement should disable the gravity. What code are you using for movement and gravity?

PostPosted: Mon Mar 05, 2007 6:16 pm
by Troodon
I think he means that the sideway movement doesn't disable the gravity. Only the falling disables sideway movement. (You can't move with feets when you don't touch the ground)