How do I keep a sprite pinned after switching layouts?

0 favourites
  • 4 posts
From the Asset Store
Minimal Sprite Font with Stroke for Pixel Art games.
  • I have a blank sprite with the platform behavior with an animation pinned to it. It works fine on the first level of the game, but after completing the level and switching layouts, the pinned animation sprite disappears on the second layout. I'm using one even sheet for all the layouts with System>On start of layout>animationsprite>pin pin to>blank sprite(position and angle) . Is it possible to do this using only one event sheet or will I need an event sheet for each layout to get the animation to pin correctly?

  • For some reason i do not like the pin behavior.what works for me every time is to create an imagepoint for your sprite where you want the other object to "pin" and then use

    every tick----- set position to another object imagepoint whatever you want.

    do not use this code underneath "on start of layout" just use it normaly as an condition.

    and do not forget to go to the second layout properties and assign as an event sheet,

    the event sheet you have.i believe that is the reason that it does not pin.

  • It depends as well on when you create each object - you can't pin what's not there yet. I'm guessing you're using global objects for this in the belief that they will transfer over; I've also found global objects to be inconsistent this way so I start my common event sheet with a bunch of create object commands instead.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the replies guys, it was actually an overlook on my part where I deleted the empty sprite on my other layout and didn't notice because it was behind my animation sprite. Roccinio, the pin behavior is working fine for me on a 100 level game with one event sheet. Colludium, not using global objects, new objects in every level, just got them all in one event sheet.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)