How do I make a bullet sprite spin as its moving?

0 favourites
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • I'm struggling with this so perhaps its easier if I just ask:

    I have a character throwing an axe. The axe has the 'bullet' behavior. It works fine. However, I would like the axe to 'appear' like it is spinning as it is moving/following the path of the bullet behavior. Is there an easy way to do this?

    The way I have done it successfully is I create an animated .gif with another program... and I basically create an animated gif of the axe picture spinning around (the animated gif was created basically by sitting there are rotating the axe picture about 10 times and then the 10 pictures are played in order making it look like the axe is spinning)... and then in Construct 2, I tell it to play the animated gif of it spinning while it is moving..... but I'm hoping I don't have to create animated gifs everytime I want to make a spinning effect.

    Is there an easy way to create this spinning picture effect this inside construct 2 without having to use animated gifs/animations? Thanks in advance.

  • Apply the rotate behavior to your sprite

  • Doh! My bad... I should have explained better.. The thing is... I have the axe going 'towards' another object... so once I apply the rotate behavior, the axe no longer follows the same path. Hopefully that makes sense in the way I explained it.. that is why I've used animated gifs...

    Is there some way to apply an 'effect' to make it 'appear' like is rotating? I tried fiddling with the 'sine' behavior but that didn't do it... and once I start using the 'rotate' behavior, I notice that my axe no longer is going towards another object like I want.

  • why not create a 'dummy' sprite with bullet behavior.then place your real sprite on top of it

    every tick place real sprite on dummy and give your real one whatever angle or behavior you want. this way bullet will not interfere with rotate

  • Rotate on the Axe, in Bullet Behaviour, disabled set angle. If you have Set Angle on, when the Axe rotates it changes the bullet direction. If its disabled, the bullet movement will fly straight while the sprite is rotating.

  • Yes Set Angle in the bullet behavior should be set to off. The only downside is there is no way in code (that I know) to turn that back on. So if you ever want your bullet behavior to go in a different direction (and it has a front/back) you will need to set both: Bullet.SetAngle and Bullet.SetAngleofMotion

  • Late to the party Here is something I was playing around with that you might , or might not, find useful ?

  • Sorry guys... I'm still confused. The ONLY way I could figure out how to get the axe to be shot towards a moving target is:

    In the bullet properties, I MUST do the following:

    Set Angle = YES

    In the Event Worksheet, I MUST do the following:

    System - Every Tick - sprite1 - set angle toward (sprite2.x,sprite2.y)

    PS: Sprite 1 = is the axe picture & Sprite 2 = a picture that I want the axe to hit which is moving.

    The above is the ONLY way I could figure out how to get the axe to be shot towards a moving target... but I still CANNOT figure out how to get the axe to spin around while it is being shot. I even tried:

    System - Every Tick - Sprite1 - Rotate 5 degrees

    Any ideas? Sorry... I'm a novice and am really struggling trying to understand this mumbo jumbo but your efforts are GREATLY appreciated.

    Unless I do this, the axe will not shoot towards another object

  • If your axe is spinning then it only needs to point left or right (ie mirrored) depending on if the angle is between (90 and 270) - it would also need the spin to go clockwise (to the right) or anticlockwise (to the left) ?

    test 2 - click mouse to make a random direction axe

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Last one from me - added bounce to the axe.

  • You guys are going to HATE me, but I'm STILL confused... for example, I looooooooooove the spinning effect that you made with the Axe. HOWEVER, if I move the log (sprite4) to a different location, the axe does NOT spin while going towards the log... the axe only spins while going across the screen... I want the axe to spin while going towards the log (wherever the log is -- which eventually will be moving).

    I TRIED to add the bullet behavior to the axe, and I TRIED to say:

    System - Every Tick - axe - set angle toward (wood.x,wood.y) -- but this stuff didn't work.

    .. But again.. I could NOT get the axe to spin around while going TOWARDS the wood. I'm sooooooo sorry to be slow with this, but I just don't get it.

    PS: It also seems like a LOT of work in the worksheet.. I would have hoped for something like, "spawn axe", then aim at the axe at the wood.. but I'm stumped.


  • ok so this is my last go...

  • I can't thank you guys enough for your patience.. and I know you are going to definitely roll your eyes and hate me, but I still do NOT get it.. the examples above do successfully make the axe spin, but it is NOT going towards the wood.

    Here is a link to my capx file. PLEASE see if you can modify this capx file so that the axe spins. In my capx file, the axe does follow the moving 'wood', but I can't figure out how to get the axe to spin.

    Once again, thanks soooooooooooooooooooo much for your ongoing patience. I honestly don't know what else to try to get the hang of this. Here is the link:

    https: // <--- I put spaces by the // because this website doesn't let me include links.

  • You need a combination of: container, hidden-sprite, Pin.

  • blackhornet: You did it! Thanks soooooooooooooooo much. NOW I understand what everybody was trying to explain to me when they mentioned pin.... I never used the 'pin' before.. but now I FINALLY understand. MUCH appreciated. Thank you everybody that helped.

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