I need help with the pin behavior

0 favourites
  • 12 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I am building an endless runner game and all of my obstacles are the same and they all spawn in how they should. I used the pin behavior to connect my particle effects to my obstacle. It works but the only problem is only one particle effect works at a time. For example: I have 3 spike obstacles that are all visible on the screen at the same time. I am trying to get all visible obstacles to all simultaneously have the pinned particle effect. However, only one obstacle at a time has the particle effect. I have to pass one of the spikes and then the particle effect disappears and reappears on the next spike trap. I want all spikes to be having the particle effect at the same time and then get destroyed when those obstacles are no longe visible

  • Add the particle and trap objects together in a container. They will be picked, created, and destroyed together as pairs.

    Otherwise, you could just create a particle instance on trap object spawned, and set the parameters in the same event. When creating an object, only the instance that was just created is picked for setting things like position, angle, size, pinning, ect.

  • Thank you! It worked. However, I have one more issue. The particles should all be shooting directly down, the particles are going towards the right. As soon as my character gets defeated the particles stop going towards the right and they shoot directly down how they should? Any tips on what I should do?

  • Set the angle of the particles object in the same event they are created.

  • My particles are 90% angle, In the event sheet I changed the angle of the particles to 90%. it still did the same thing. I played around with it and set the particles angle to 0 and still had it on 90 in the event sheet but it did the same thing

  • Are you setting the correct angle property? I haven't looked but I think you can set the angle of individual particles and the angle of the particle object/spray cone direction separately. Make sure you're using the right action.

  • I am using a flappy template and I connected particles to the pipes. When I am moving the particles always go towards an angle. However, when I die the particles go straight down how they should be. I have looked at all of the events and I have found that the pipes are set for "every tick, set bullet angle of motion to 180 degrees" Since the particles are pinned to the pipes they also move that way. I want the pipe to remain the same, and have the particles still pinned to the bullets but have the particles go straight down instead of at an angle. I have tried many different settings and have been unsuccessful.

  • Aha. There is a completely different problem here.

    So in flappy bird, rather than the player moving, the stage actually moves around your character. Instead of the player moving right, what is really happening is that everything else is moving left. After your particles get created, they stay in the same location and don't move left with the rest of the objects when they move.

    I don't think there is a way to control the particles made by the particle object to fix this. However, what you can do is create your own particles with sprite objects that have the fade and bullet behavior. Every X seconds, create the sprite object at origin x, y, set bullet angle of motion to random(a-n,a+n) where a is the target angle and n is the variance, set fade time and duration, bullet speed, ect. Then you put these sprite object "particles" in the same family as the rest of the level obstacle objects, and they will move along with the rest of the stage.

  • I tried doing this and I do not fully understand the steps? Could you maybe send a picture of the events?

  • I am making some more progress. all of the particles are going straight left and I am messing around with it trying to get it to go down

  • I am struggling so bad with this. I have spent days trying to fix this. I changed the settings, I have managed to make the particles move straight up, to the left, to the right, every way possible except for the way I am trying to make them. I used the pin object, I tried what you said and made them a bullet, I made them a child object of my wall, anything I could think of

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • dropbox.com/s/blorwx6feu6xk7k/particlemovementexample.c3p

    Basically you need to make your individual particles move left at the same rate as everything else.

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