How do I set angle for bullet on a self spinning object.

0 favourites
  • 5 posts
From the Asset Store
****** Animated rotating torpedo game asset ********
  • Hello guys,

    I am trying to set a straight shooter object which is spinning on its own center. It is a sprite set.

    I set the shoot point on the head site of the object and set it for each sprite image.

    It is shooting but always on the same angle and to the same direction. But I want it to shoot straight ahead from the head to 0 degrees.

    My object rotates by 30 degrees. I set the timer per 4 seconds to shoot. So Icould not find a solution for my problem.

    If anyone can help me out it is highly appretiated.

    Cheers

    Cantek

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Do you mean:

    set bullet angle of motion - object.angle?

  • Lets say, there ıs the rocket launcher, whıch ıs stupıd and just turning around, I want it to fire on the side, direction that it looks at that moment.

    I am not sure what to understand from your suggestion. I already tried to set the angle of the bullet as launcher.angel , It did not work. Bullet always goes to same direction no matter the direction of the launcher.

    Cheers

  • I attached the code I have and the screenshot of what is happening. Maybe it can explain better.

  • OK,

    I did it.

    The motion and so on are useless if you do not know what is the angle exactly. So I calculated the angle of the current Sprite and used it to set the motion angle of the bullet.

    set motion angle -> black2.AnimationFrame * 22.5

    This solved the problem, ofcourse if you are starting from the 0 and if your gun is looking to 0 degrees.

    Cheers

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