Spray the particles in the desired direction

Not favoritedFavorited Favorited 0 favourites
  • 13 posts
From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • Hey, guys. There was a problem, I make a watering system, and there is a "Water sprayer" on the field, and it turns. Water particles are made through "Particles". The sprayer looks to the right, and the liquid is sprayed from the top and bottom through the snap to the points.

    I make the angle as follows: loopindex ("watering") = 0? -90: 90, and this works exactly until the start of rotation of the sprayer. How do I make sure that, regardless of the angle of rotation of the sprayer, the particles always spray in the right direction?

  • You can use Pin behavior and pin particles to the sprayer object. Make sure to tick "Pin angle".

    Or create Hierarchy - add particles as children to the sprayer.

  • You can use Pin behavior and pin particles to the sprayer object. Make sure to tick "Pin angle".

    Or create Hierarchy - add particles as children to the sprayer.

    Thank you for your help, but can I get an example? I'm still new to C3 and just learning it, and a lot is still unclear(

  • Add Pin behavior to Particles object. After your spawn them and set their angle, in the same event add "Particles Pin to Sprayer" action.

    Now particles will be attached to the sprayer, and will move and rotate with it.

  • Add Pin behavior to Particles object. After your spawn them and set their angle, in the same event add "Particles Pin to Sprayer" action.

    Now particles will be attached to the sprayer, and will move and rotate with it.

    I tried, but it's not something slightly what I need. I don't have a problem that they are not rotating with the "sprayer", but that when the sprayer rotates, the "particles" leave their angle in -90 and 90 degrees. When the sprayer does not spin and turn right, then everything works, as should, some particles are up, and others down. But when the rotation begins, then the particles begin to sprinkle incorrectly. I need, regardless of the rotation of the "sprayer", the particles are static in the desired directions.

    Example: "Sprayer" will be rotated to the right "particles" spray one up, and the other down, turn down the "particles" is sprayed alone in the right, and the other in the left, etc.

  • Maybe I don't understand the task, but if you pin particles to the sprayer, they will work exactly as you described.

    dropbox.com/s/p2bmrms4opya4vo/PinParticles.c3p

  • Maybe I don't understand the task, but if you pin particles to the sprayer, they will work exactly as you described.

    https://www.dropbox.com/s/p2bmrms4opya4vo/PinParticles.c3p?dl=0

    A great example. But it doesn't work for me. I have everything laid out in animations, the points I need are in Sprayer2A - watering1 and watering2. I try to find these points through the cycle, but it does not find them, and therefore everything does not work (((

  • You can use "watering"&loopindex as the name of the imagepoint where particles will be spawned.

    Or just add them on the layout and attach to the sprite using hierarchy.

    dropbox.com/s/6nh768em0c1ws4n/PinParticles2.c3p

  • You can use "watering"&loopindex as the name of the imagepoint where particles will be spawned.

    Or just add them on the layout and attach to the sprite using hierarchy.

    https://www.dropbox.com/s/6nh768em0c1ws4n/PinParticles2.c3p?dl=0

    I give up. In the example everything works well, but nothing works for me. I tried to do it both with the name and without the name, and all the same it feels like he does not find a point. Spawn particles by zero point and that's it (I don't have a hierarchy tab, and I found in the documentation how to do it.

  • Can you share your project file?

  • Can you share your project file?

    I tried it on another project, and everything works, but the problem remains. Particles when rotated (here the tower rotates towards the mouse) stop being sprayed correctly(

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So you rotate the TankTower first, and then spawn particles? In this case you don't need pin.

    Try setting partciles angle to (loopindex=1?-90:90)+TankTower.angle

  • So you rotate the TankTower first, and then spawn particles? In this case you don't need pin.

    Try setting partciles angle to (loopindex=1?-90:90)+TankTower.angle

    Thank you so much, now everything is working as it should.

    Now one can try on the in main game)

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