Collisions(or lack there of)

Peter_OlafsonPeter_Olafson Member Posts: 301
edited June 2012 in Working with GS (Mac)
I'm trying to keep an object inside a circle(a dish basically). I set up a series of square actors around the edge of the dish and set them as obstacles. The object on the dish moves in a random direction. Half the time it will collide with the edge and bounce away. Half the time it will completely ignore the edge of the dish and keep on going. :-/

Is there a formula to keep the object constrained within the circle or is there some magical way to make collisions actually work? I can't have the object flying off into space and I can't release this game if collisions aren't working.

Answers

  • Peter_OlafsonPeter_Olafson Member Posts: 301
    Adding a collide behavior to the wall as opposed to a rule for collisions seemed to work wonders.
  • kinzuakinzua Member Posts: 554
    @PeterGisHere u can also use the min max behavior of GS, instead of having colliding actors. I tried it in one of my scratch codes, and boy .. does it work.. take a look at some of @tshirtbooth videos to get what i am saying. It'll help you in avoiding the use of actors plus it'll help u evolve and use GS in a better manner.
  • Peter_OlafsonPeter_Olafson Member Posts: 301
    Thanks for the feedback. I just watched his min max tutorial. Unfortunately that constrains inside a square. I need to constrain inside a circle. It's been a long time since calculus but I might be able to dig up a formula.
  • Peter_OlafsonPeter_Olafson Member Posts: 301
    Thanks tshirt. I'll check it when I get home from the drudge of my 9 to 5.
  • Peter_OlafsonPeter_Olafson Member Posts: 301
    Ok, I think that will work. The object isn't being dragged but moving on its own. I'll just remove the mouse language.
Sign In or Register to comment.