Firing Portals

So I'm trying to make portal in Mario.

I've got a firing mechanism from a previous post, but when I move beyond where the camera starts, the portals will only fire left. I've tried so many things and spent a significant amount of time on this to no avail.

Here is the project: https://db.tt/ICyfAzao (Dropbox)

Any help would be appreciated!

Comments

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

    Use a DisplayText behavior to watch the value of game.touchX as you move around the scene. You'll see that it varies when clicking on the same spot in the game because of the camera offset. You'll need to include a camera offset value in your calculations.

    If you unlock an actor in the scene and use Display Text to watch scene.Camera.Origin.X, you'll get some insights into how to figure out the offset. I found that game.touchX +scene.Camera.Origin.X worked well.

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

Sign In or Register to comment.