Bouncing Beachball inside 4 walls with other beachballs.

CaptFinnCaptFinn Member Posts: 1,828

I want to randomly spawn a beachball ever 4 secs at one of 4 locations within the scene. The scene is enclosed with 4 walls.

When it spawns it and every spawned beach ball will begin traveling at 1 set speed. These balls will collide with other balls and the 4 walls. At no point during the chaos do i want the beachballs to slow or speed up in speed. I want one constant speed at all times.

Thanks to the forum i have fixed the rotation issue. I now know how to make them rotate or not. Now im at a point to where the actors want to slow down and speed up after each contact. I just need the spawned balls to stay at a constant speed of my editing and choosing.

Any advice.

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211

    My magnitude demo over at gshelper.com solves the speed issue with bouncing balls losing speed over time. Or at least it did 7 years ago when i made it. :-)

    Search for firemaplegames to bring up all my old demos.

    Hope it helps!
    Joe

  • CaptFinnCaptFinn Member Posts: 1,828

    Does this also stop them from speeding up real fast?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    To stop something from moving too fast you can set a max speed for each actor and activate apply max speed in the actors settings. Then the actor won't move faster than its max speed.

  • CaptFinnCaptFinn Member Posts: 1,828

    Ok so set actor max speed 150 and it will never go faster than 150. Is that the same as constraining linear velocity X and Y to 150?

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    @FINNBOGG said:
    Ok so set actor max speed 150 and it will never go faster than 150. Is that the same as constraining linear velocity X and Y to 150?

    No. Max speed allows for changes up and down of velocity as where a constrain fixes it to that value.

  • CaptFinnCaptFinn Member Posts: 1,828

    K so constrain self. Velocity to 150. And it will always stay at 150? What if 2 balls hit head on? Will they bounce off in opposite directions at 150?

  • SocksSocks London, UK.Member Posts: 12,822

    @FINNBOGG said:
    K so constrain self. Velocity to 150.

    There is no attribute called (simply) self.velocity, you have velocity X and velocity Y, but constraining either (or both) of these to 150 won't make the overall speed 150 (unless one of the two values is also always 0).

    @FINNBOGG said:
    And it will always stay at 150? What if 2 balls hit head on? Will they bounce off in opposite directions at 150?

    You could try something like:

    Rule:
    -When ball collides with ball
    --Change Velocity
    --Direction vectorToAngle (velocity X, velocity Y)
    --Speed 150

Sign In or Register to comment.