GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Constrain one actor to another actors random spawn value - Logic Check

CiaphisCiaphis Posts: 58Member, PRO

I am spawning a goal sensor (score manipulator zone) and Am needing a quick check on my logic.

I create:

Global Boolean: goalPosY

Constrain the game.goalPosY to DualObj.PositionY

Spawn new actor to X:1050 and Y: gamePosY

I am sure I am missing some small detail (switched containers) but I have music to play and beer to drink on this glorious saturday!

If someone could look this over, don't out right give me the answer out right, give me a clue so I can figure it out.

thanks,
Dave

Comments

  • tatiangtatiang Posts: 11,335Member, Sous Chef, PRO, Senior Sous-Chef

    What is gamePosY? Did you mean to write game.goalPosY? Also, any time you're using position values you're going to want a Real attribute rather than something else (definitely not a Boolean since those only hold true/false or 1/0 values).

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

  • tatiangtatiang Posts: 11,335Member, Sous Chef, PRO, Senior Sous-Chef

    You might want to do this without a constrain behavior. Not sure exactly how your game is set up since you didn't provide a lot of details but you can probably just have the goal (or whatever DualObj is) spawn the sensor at X:1050 and Y: self.Position.Y [both relative to scene].

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

  • CiaphisCiaphis Posts: 58Member, PRO
    edited May 20

    Gotcha that makes sense, that’s what I was trying to do. I will post back with my progress tomorrow with this issue

  • CiaphisCiaphis Posts: 58Member, PRO

    I love overthinking stuff! said no one ever... .

    In the end all I needed to do was make the goal sensor actor W: 20px H:768 and spawn it with the DualObj actor , mirror the movement and spawn actor logic between the two.

  • CiaphisCiaphis Posts: 58Member, PRO

    just finished this bit up. got the sensor spawned to the right actor, in the correct position at the correct frequency.

    Also got the score bit working properly.

Sign In or Register to comment.