GameMaker: Turret rotation (with limits)


It's actually pretty hard to describe what this does without an image.

This intermediate example demonstrates, how to create turrets with limited rotation range, and fixed rotation speed.
Basic use for this would be to create units that cannot shoot backwards without rotating towards angle entirely.

Download

Related posts:

5 thoughts on “GameMaker: Turret rotation (with limits)

  1. trying to do this in studio, the example runs fine btw. But recreating into an existing project was problematic, only the one error though. The creation event for the base obj. Line 2 ; turret.base = id
    It is expecting a variable?

    Thanks again.

  2. Could you fix this? As this does not run on studio. Comes up with a few errors when trying to start the example. Thanks for these examples and tutorials.

      • Comes up with a single error regarding deprecated function for me. Can be fixed by replacing problematic line with “t = get_timer() / 1000000 * 5”, for example.

Leave a Reply to Laice1 Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.