Why does actor rotate after spawning another actor?

The shooting actor can be rotated through controls to a certain position. When a button is pressed it can spawn another actor. However, when this second actor is spawn, the first (i.e. shooting) actor gets rotated around (even though no controls are active and the angle for the shooting actor does not change, which I checked that with display text. So it seems the shooting actor gets bounced around by the spawning actor, but I can find nothing in the physics settings that would make this happen. What can I do to fix this?

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Welcome to the forums. Do you have a collide behavior on either actor? If not, they won't directly affect each other.

    Without seeing your rules, it's hard to know why the spawner actor is moving after spawning.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • GabTobBenGabTobBen Member Posts: 6
    Hi Tatiang. No Collide behavior on the shooting actor, and only one colliding rule on the spawned actor, but with another actor not the shooting one.

    I can share the rules if that helps.
    Many thanks in advance
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Post a screenshot of your rules, if possible. Instructions are in my signature below.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • GabTobBenGabTobBen Member Posts: 6
    Had started writing down the ruels while posted. Hope this can help. Here the rules for the actors

    attributes
    DigitalWater (boolean) : spawned actor on screen
    WaterFlow (boolean): actor can be spawned
    X (real): attribute that stores the touch X position

    Spawned actor:
    accelerate direction 0 relative to actor, speed 300
    when collision with (third actor: unrelated to shooting actor) destroy
    attribute DigitalWater to False (ie no spawned actor on screen)

    Shooting actor
    rotate to (constant_a-constant_b*X) relative to scene, speed 200
    when WaterFlow true, change attribute DigitalWater to true
    Spawn actor (ie above actor) in back of actor, direction 90 relative to actor (rest is 0)
    change attribute WaterFlow to false
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I don't see any reason that the Shooting actor would rotate other than however it is currently rotating with (constant_a-constant_b*X) relative to scene, as you listed above.

    Double-check that you haven't unlocked any of your actors on the scene (if you double-click on an actor on the scene itself you should see the lock symbol). If you have, try deleting and re-adding the actor to the scene. Unlocked instances have different rules from their locked prototypes that appear in the Actor inspector pane.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • GabTobBenGabTobBen Member Posts: 6
    I checked whether any of the actors are unlocked, however, they are all locked.
    Anything else that could help?
  • SocksSocks London, UK.Member Posts: 12,822
    What does this mean . . . .
    . . .

    rotate to (constant_a-constant_b*X)


    I know you say it rotates "through controls", but could you be more specific, what kind of controls are you using ?
  • GabTobBenGabTobBen Member Posts: 6
    Now it seems fixed, what I did is remove the shooting actor, introduce a new actor and gave it the rules of the 'old' actor.
  • GabTobBenGabTobBen Member Posts: 6
    Help! I am not succeeding in getting the shooting actor to stop spinning when it spawns an actor. I thought it was fixed, but it started again, after which I tried tons of different things but nothing keeps the shooting actor from spinning. I have posted the rules on this link. Hope Socks or Tatiang,you can still help? ?

    https://www.dropbox.com/s/t1x1mf44xhr3ctv/Shooting actor rotates after spawning actor.odt
  • GabTobBenGabTobBen Member Posts: 6
    Many thanks to Bob from GameSalad for helping to solve this. Solution was to use self.rotation instead of the command behaviour 'rotate to angle'.
Sign In or Register to comment.