g3nki Posted January 9, 2023 Report Share Posted January 9, 2023 Hi! This might be a silly question, but I have had a REALLY rough time figuring out a solution of how I can spawn sprite objects in Construct3 from several instance of the same Spriter Object, does anyone know here on the forum? This is my scenario: Player uses "Slash"-sprite to hit "SpriterObject", then I want to spawn a "Hit"-sprite (+animation). I tried this: - "Slash" on Collision with "SpriterObject" > Create "Hit" at SpriterObject.X & SpriterObject.Y. This works as long as you hit a single instance of the Spriter Object. However, if two objects are caught up in the "Slash"-collision at the exact same frame. Only the last instance will get a "Hit"-sprite created. In comparison, C3's "Sprite"-object has a built-in function called "Spawn Object", that fixes this issue. HOWEVER, This feature is not available for Spriter Objects (I'm using the drawSelf export to C3). I found a solution by creating the "Hit" object at SpriterObject > On Created, and adding "Hit" as a child to the Spriter Object, then replaying the animation every time "Slash" hits. This actually works. But it isn't really a solution, because, what if I want to spawn projectiles from multiple instances of a spriter object? In case they want to spawn on the same frame, only the last one will spawn a projectile. It would be great if the plugin offered a "spawn object"-function similar to C3's Sprite-object does Perhaps there's already a much better way to do all of this? I might have been overthinking and making over-complicated workaround solutions? But I have been struggling with this for quite a while. Quote Link to comment Share on other sites More sharing options...
Mike at BrashMonkey Posted August 11, 2023 Report Share Posted August 11, 2023 Have you used triggers yet in Spriter animations? If the Spriter objects getting hit also play getting hit animations, then you could have a trigger at the very beginning of the animation (for example, call the trigger "SLASH") and then in Construct you could do the "On Event Triggered" event to then Spawn that effect sprite... or even build the slash effect into the hit animation.. otherwise, could you perhaps post a screen grab here of your logic and maybe I or someone else can figure out a way to fix it or make it work? Sorry for the very late reply. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.