no bounce in cross platform controller template

freon1200freon1200 Member Posts: 50
edited November -1 in Working with GS (Mac)
help =[
my game is soooo close to done but the controls are horrible. i switched over to the Official Cross Platform Controller Template. my main player actor used to bounce off a wall and if you held the controller in it would keep going the other way till you let go. now its like it non stop refreshes the direction, so if i hold up it hits the wall like 50 times a sec (random stat) how do i get the bounce back?

try making an actor with collision on the DPad_Style2 or the Thumbstick_Style2 scenes and collide with the main actor to see what i mean. (in the Official Cross Platform Controller Template)

my old style was the x and y attrib and the if game right = true
change velocity right 300

but it would stop moving whenever you hit 2 buttons by accident. and i got used to them but NO ONE else could even beat the 1st lvl on SUPER eazy, which means BAD reviews and no sales =[. the thumbstick style 2 is awesome except it doesnt bounce. plus i dont know how to make it one velocity instead of speeding up (anyone who knows how, id love to hear how)

thanks everyone for reading this, and extra thanks to anyone who answers =]

Comments

  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Go into both actors, the 1 that moves with the sticks and the wall it collides with, on the left hand side under attributes, go to physics and change the restitution values. 0 means there is no bounce, i believe it goes up to 3 so find somewhere in between there that feels right.
  • freon1200freon1200 Member Posts: 50
    Thanks beefy, tho thats not the problem, i didnt change the restitution before i merged the controls, and even if i change the restitution, the exact second it hits the wall and kinda bounces and it keeps going towards the wall again. where as before when you hit the wall if you held the control it would bounce and head the other direction.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    Surely though, for instance, if your holding left, hit a wall, after the bounce its still going to go left if your holding the left direction?
  • freon1200freon1200 Member Posts: 50
    i dont remembr which Tshirtbooth video i used to make the controls, but they are basically like i said in the first post. so if right = true, velocity (angle 0, or right) 300. otherwise velocity 0. and even if you make a basic wall with collision and hit an actor into it it will bounce before it returns. where as when i use the Official Cross Platform Controller Template it acts like there is a refresh every .1 seconds. and always reverts to o velocity, i assume so there is no error. tho it doesnt bounce. even with hi restitution. the tutorial i used made it so when you hit a wall and it bounced, it kept going till you let go of the button. even if you kept holding right it would go left for a while. try adding collision to the template to see what i mean. its like uber fast micro-bounces. but without real bounce i cant use it
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Your description sounds like the main player has tunneled inside the wall and can't escape before the next collision is detected. When that happens it just looks like its jittering back and forth as fast as it can (because it is).

    This often happens when the actor is traveling so fast that it gets too far into the wall before the collision detection takes place. To test if this is what is happening try slowing down the velocity and see if it is still sticking inside the wall.

    One solution is to simply move the actor away from the wall when a collision happens. (Change attribute self.position.x to: self.position.x + 5. Or something like that.)

    RThurman
  • freon1200freon1200 Member Posts: 50
    i tried that, though i am not getting stuck in the wall or actor. i wish someone would just go into the Official Cross Platform Controller Template and add collision and fly a ship into the wall, they will see exactly what im talking about. i want it top bounce far back almost as if it were a ball or something, even making the restitution 2 it still does the many small quick bounces =[
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    OK -- I went to thumstick_style2 and put a wall on the right side. (The wall is fixed rotation and not moveable. Name = myWall.)

    I put a collide behavior in the skywardA actor: bounce when colliding with actor of type myWall.

    When I use the controller to move the ship to the right. Sure enough it moves right until it hits the wall. Then (since I'm still holding the controller to the right) the ship keeps hitting the wall. When I release the controller, the ship quits bouncing against the wall.

    What next?
  • freon1200freon1200 Member Posts: 50
    but when i do it, the ship bounces like 1/2mm bounces and very very fast, not like a normal bounce. thats what i want to know is how to make it bounce normal, i tried messing with restitution. and other settings. i havent changed any settings on my actor and it would do a nice bounce before this happened =[. now it just bounces sooo small and fast its like its sticking to the wall. my game has tight areas you have to get throu very carefully without hitting the objects. and with this it doesnt work, and i CANT figure out how to make it bounce like normal =/

    o and btw RThurman, thank you for trying this out for me, i appreciate it.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Well, the the controller is forcing the actor to the right. When the actor hits the wall (and tries to bounce) the controller is still pushing it to the right. The little micro bounces are are the result of a bounce left and a forced 'push' to the right. The actor has no choice but to vibrate like that.

    Wouldn't it destroy any sense of user control if all of a sudden the controller didn't work? The poor user would be mashing the controller to the right, but the ship still just bounces left like a ball? How would the user regain control?

    edit: Never mind. That's probably the effect you are looking for. It would make it more fun to try to regain control.
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    OK -- here is a workaround that might be helpful. It involves modifying the "Analog Style Movement Control Based on Thumstick 1 Logic" group. Hopefully the picture will load.

    Photobucket
  • freon1200freon1200 Member Posts: 50
    WOW!! RThurman thats definately a LOT better. tho not quite what im trying for. i have a VERY ultra lite of my game. how do i upload it so i can show how mine reacts?
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Glad its working better for you.

    I am not sure how to upload projects to GameSalad. Can't help much there. I have used http://www.speedyshare.com to make files available for others to view. Something like that might be an option. (The file is deleted from their servers after a few days.)
  • freon1200freon1200 Member Posts: 50
    ok so i made an ULTRALITE 1 scene barebones of my game. tho i may have left a few attributes that are for other scenes. (i started this game before i had a clue what i was doing with a LOT of youtube videos, lol) anyways i thought that i originally used a T-shirtbooth video to make my controls, but the setup doesnt match. i know i made the keyboard controls first, then i made the touchscreen controls much later. but the bounce works with both, so i assume its in the player itself. but i cant figure out how to do it with the new controls from the Official Cross Platform Controller Template. but they work sooo much smoother than mine. im trying to use the analogue stick from scene 2, or would use the d-pad from scene 5 if i had to. but i NEED the bounce (from collision) like on my game and i dont know how to get it =/ with the controls from scene 2. if someone could try my scene out to see the bounce im talking about i would greatly appreciate it.

    btw sorry to anyone if it seems like im not being clear on what i want. im not good at wording things XD. thanks again to all who helped me soo far and/or all who have tried =] heres a link:

    http://www.speedyshare.com/files/30449562/freon1200_lite.gameproj.zip
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    I took a look at your example you posted and compared it to the controller setup on the Template. They certainly are different. It looks to me that the very thing that you like about the Template controller is the thing that makes it difficult to bounce like you want. It is the difference between using change velocity (an action) and move (a persistent behavior). The move behavior is what gives the thumbstick controller such such fine sense of control. But its also what mashes the player up against the wall so forcefully.

    I tried to come up with some other options, but I couldn't get anything to work as well as the suggestion from yesterday. Perhaps if you tried to use yesterday's suggestion, but increase (or perhaps decrease) the speed, or perhaps increase the time of the 'bounce.'

    Maybe someone else who uses the controller Template has already figured this out and will post a suggestion.
  • freon1200freon1200 Member Posts: 50
    thank you for trying it out for me and the advice RThurman. i did try making the speed faster which gave a little more bounce, but the bounce became sooo fast that it didnt work right =/. even if it could be done with the d-pad in scene 5 of the template id be happy with that. b/c originally my controls had up and down on the right side of the screen and left and right on the left side of the screen, and they tended to make the actor stop if one wasnt precise in movenmnts. do you know whats causing my actor to bounce the other way tho? i cant see any behaviors that i have in there that cause it to do so. but it makes the control soo nice except the needing to be very precise =/
Sign In or Register to comment.