need help with orbiting effect for my spell

millzy

Ultra Cool Member
Reaction score
44
ok well im trying to make a spell for my cinematic where units(my effect) are created around the caster and they orbit around the caster.

but what is happaning after the units are created they just all go to the one spot.
what do i have to do so that the units rotate around the caster and not all move to the one spot

i want the units to rotate around the caster
----x----
-x--o--x-
----x----

but they end up like this all on top of each other
----x----
----o----
---------

x - effect units
o - caster


here are my triggers
Trigger:
  • effect spin spin
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to effect 3
    • Actions
      • Set center = (Position of (Triggering unit))
      • Set caster = (Triggering unit)
      • For each (Integer A) from 1 to 40, do (Actions)
        • Loop - Actions
          • Unit - Create 1 dummy missle 3 for (Owner of (Triggering unit)) at (center offset by 400.00 towards ((Real((Integer A))) x (360.00 / 40.00)) degrees) facing (Position of (Triggering unit))
          • Unit Group - Add (Last created unit) to spingroup
      • Trigger - Turn on effect spin <gen>
      • Wait 5.00 seconds
      • Unit Group - Pick every unit in spingroup and do (Unit - Remove (Picked unit) from the game)
      • Unit Group - Pick every unit in spingroup and do (Unit - Remove (Picked unit) from the game)
      • Trigger - Turn off effect spin <gen>


Trigger:
  • effect spin
    • Events
      • Time - Every 0.40 seconds of game time
    • Conditions
    • Actions
      • Set spincenter = (Position of caster)
      • Unit Group - Pick every unit in spingroup and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (spincenter offset by (Distance between spincenter and (Position of (Picked unit))) towards ((Distance between spincenter and (Position of (Picked unit))) + 20.00) degrees), facing spincenter
      • Custom script: call RemoveLocation (udg_spincenter)
 

Ghan

Administrator - Servers are fun
Staff member
Reaction score
888
Trigger:
  • Move (Picked unit) instantly to (spincenter offset by (Distance between spincenter and (Position of (Picked unit))) towards ((Distance between spincenter and (Position of (Picked unit))) + 20.00) degrees), facing spincenter



Here is your problem. If you are using the distance between the caster and the units and the ANGLE, then they will all have the same angle since they are all the same distance from the caster. What you want to do is something like this:

towards (Angle between spincenter and (Position of (Picked Unit)) + 20.00) degrees
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top