Page 1 of 1

help with the player sliding

PostPosted: Tue Aug 23, 2016 7:58 pm
by nightFall16
i have tis which the player should be able to slide on the ground but when he start sliding he never stops
so maybe it's has something to do with my code please some one tell me what i'am doing wrong

Re: help with the player sliding

PostPosted: Thu Aug 25, 2016 4:51 am
by Zivouhr
I don't have a PC, as it says I need that newer version of Game Editor to read the file, but if I had a character that was sliding, I have to create a way for it to stop, and the best way to do that is with a path finish, provided there was a path to get the character started.

Since I can't see what the game is like and what the intent of the sliding is for, I can only give some very basic advice:

Let's say the actor collides with something that cause it to begin sliding on a path.

Actor/Add Collision Event/with Any Side of Actor 2/Script Editor
Variables/change path/Event Actor/path/slideright (create the path when prompted)/Axis/x axis

Then, to stop that path from repeating and stopping:
Actor/Add Path Finish/slideright/script editor/
ChangePath("Event Actor", "(none)", X_AXIS;

That's the general idea anyway. You can add conditions to that through variables, but that gets a lot more complex to explain.
I would help more, but am very booked up with other projects including my own game editor game project. Best of luck! 8)

Re: help with the player sliding

PostPosted: Thu Aug 25, 2016 6:13 pm
by nightFall16
thanks man but i already did what u said but the path finish thing is not stopping the player at all and the player is not repeating the path
he jus keep sliding for ever , then i tried to make an actor at the end of the slide (by the way the slide is down hill ) and used angle fun- and directional_velo-
to make the player slide down to the actor and when it collides it should stop but again the same problem (i thing it could be from my draw actor code i usually animate my player from only draw actor without any key down or up ) , and by the way the angle way worked so good in another testing game with only ke right and key left with no gravity
i was thinking that some one can read my code and tell me what is wrong
an hey one more Q when the player is colliding the slide which side he is colliding (top or right ??) and do the phesical response affect the sliding ?? somehow ? cuz in a game wit no gravity (then no phisical response needed ) it works so great