Bounce

OK so let's say there's a ball on the screen and the ball is moving downwards at a constant speed. A rock comes in from the side and hits the ball, bouncing off the ball at a much faster speed than it was going before it hit the ball. But the ball is unaltered whatsoever by the rock. Help?

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Have you got a bounce behaviour on your ball? Set it to bounce when colliding with rock
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    edited September 2013
    You want the ball to not bounce and stay straight you need to lock it's linear velocity in a certain direction - I have made a simple example that does what you ask. Not sure if it will be suitable but it does do exactly what you ask - the specifics or ball controls might affect this however - it uses constrain which locks the player to a certain value of linear velocity and speed.
  • gineepiggineepig Member Posts: 26
    @matarua That was perfect thanks.
  • gineepiggineepig Member Posts: 26
    @matarua Actually for my game, the rock is the player and whenever I hit the ball, the ball still moves a little bit. And I want it to stay in place with all the other balls, so they look like a solid mass of seperate balls.
  • gineepiggineepig Member Posts: 26
    Sort of like a ship moving through small islands.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    It's a little tricky to visualise - you could upload pics or the project - something to help - it's not easy to just come up with a solution based on this so far sorry :-S
  • colandercolander Member Posts: 1,610
    Put a check mark in Fixed Rotation this will stop it turning if that is what you mean.
  • gineepiggineepig Member Posts: 26
    @matarua http://postimg.org/image/ijpjwbobr/ I hope you get my drift. I want the green to all hold their positions relative to each other while moving down the screen. I want the red(player) to bounce off of them.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    What I posted before does that - you just needed to delete all the little red blocks and duplicate the white blocks.

    Here's an update - but to do this it might be better to just lock all the objects and then scroll the camera instead. Much less overhead.

  • gineepiggineepig Member Posts: 26
    @matarua I would but I'm trying to make an endless game. I did exactly what was on the template, yet every time my player hits them, since I'm making the player hit them, they nudge a little. I even copied my player into your template, and they nudge. Is that just because I'm playing it on the computer or is that problem going to carry over to the device?
  • gineepiggineepig Member Posts: 26
    Sorry to keep you with this.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    Nope they should never move off their axis - you could up their density in the physics and then lower it on your player perhaps which would me it's like a rock and ping pong ball - that might help? Perhaps look at some endless templates and you might get some ideas :) All the best, cheers, M@
  • gineepiggineepig Member Posts: 26
    @matarua Just wanna let you know your density idea worked sooo great thanks, you saved my game with that.
  • mataruamatarua Auckland, New ZealandMember Posts: 854
    @gineepig awesome :) Glad that worked!
Sign In or Register to comment.