how to make actor moving back and forth at a same place?

raggragg Member Posts: 65
edited November -1 in Working with GS (Mac)
hey guys...how to make the actors which is moving right and left itself,to only at a particular distance and place?i use timer to change its linear x motion to negative every few seconds...and it works...but when my main actor collide with those moving actors,it will bounce them away...causing the moving actors to move left and right at a different place....how to solve this?any help please..thanks

Comments

  • synthesissynthesis Member Posts: 1,693
    Please clarify the question...it doesn't make sense (to me at least).
  • raggragg Member Posts: 65
    sry for that...what i mean is
    1.i have some moving actors which are constantly moving right and left...i use the method from wiki: http://gamesalad.com/wiki/how_tos:gsc_pacing
    2.i have a main actor which i control and will collide with the moving actors horizontally
    3.everytime my main actor collide with the moving actors..it will bounce the moving actors further away..at the end...the moving actors will be off screen...
    i want my main actor to be able to collide with the moving actors...but i dont want it to bounce them off...
  • SparkyidrSparkyidr Member Posts: 2,033
    rather than using "collide" (which I assume you are doing) you will need to se up some rules using "overlap or collides with" in the rule, and then creating some rules to tell your game what you want to happen when that happens.
  • giacomopoppigiacomopoppi Member, PRO Posts: 914
    @ragg , all you need to do is change the "restitution" of both actors to 0
    go in the actor editor and to your left, under Physics there is restitution.
    it should work :)
  • synthesissynthesis Member Posts: 1,693
    Use the restitution (aka bounciness) and collision strategy per Giacom when you want an "automated" physics result.

    If you want an event (such as when the 2 actors touch...do something), then use a rule per Sparky's suggestion.
  • raggragg Member Posts: 65
    guys..thanks for the reply...turning off the restitution wont work for me...my main actor will still bounce the moving actors away when collide with them...here how i did...
    i make some new actors to constrain its position to the moving actors and make them collidable with main actor...then take off collide behaviour from the moving actors...now the new actors wont bounce off whenever it collide with main actor...i know it's a stupid idea as it will slow down my fps...if u guys hav any idea..please share with me...thanks!
    btw...when should i turn on run to completion in the timer?i notice the timer not so accurate as the moving actors move away to off screen as it moving back forth..
Sign In or Register to comment.