• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Rotating wierdly

Status
Not open for further replies.
Level 5
Joined
Sep 27, 2011
Messages
141
I have made a trigger to rotate the camera but whenever it faces about directly down it quickly spins to face the left then it just gets stuck going in circles can someone please help
  • Movement System
    • Events
      • Timer - Every 0.03 seconds of Game Time
    • Local Variables
    • Conditions
    • Actions
      • Player Group - Pick each player in (All players) and do (Actions)
        • Actions
          • Variable - Set Temp_Int = (Picked player)
          • Variable - Set Temp_Loc = (Position of Player_Hero[Temp_Int])
          • General - If (Conditions) then do (Actions) else do (Actions)
            • If
              • And
                • Conditions
                  • Player_Forward[Temp_Int] == True
                  • Player_Backward[Temp_Int] == False
                  • Player_Left[Temp_Int] == False
                  • Player_Right[Temp_Int] == False
            • Then
              • Variable - Set Temp_Loc 2 = (Temp_Loc offset by 0.25 towards (Facing of Player_Hero[Temp_Int]) degrees)
              • Unit - Move Player_Hero[Temp_Int] instantly to Temp_Loc 2 (Blend)
            • Else
              • General - If (Conditions) then do (Actions) else do (Actions)
                • If
                  • And
                    • Conditions
                      • Player_Forward[Temp_Int] == False
                      • Player_Backward[Temp_Int] == False
                      • Player_Left[Temp_Int] == True
                      • Player_Right[Temp_Int] == False
                • Then
                  • Variable - Set Temp_Loc 2 = (Temp_Loc offset by 0.07 towards ((Facing of Player_Hero[Temp_Int]) + 8.0) degrees)
                  • Unit - Make Player_Hero[Temp_Int] face Temp_Loc 2 over 0.5 seconds
                • Else
                  • General - If (Conditions) then do (Actions) else do (Actions)
                    • If
                      • And
                        • Conditions
                          • Player_Forward[Temp_Int] == False
                          • Player_Backward[Temp_Int] == False
                          • Player_Left[Temp_Int] == False
                          • Player_Right[Temp_Int] == True
                    • Then
                      • Variable - Set Temp_Loc 2 = (Temp_Loc offset by 0.07 towards ((Facing of Player_Hero[Temp_Int]) - 8.0) degrees)
                      • Unit - Make Player_Hero[Temp_Int] face Temp_Loc 2 over 0.5 seconds
                    • Else
                      • General - If (Conditions) then do (Actions) else do (Actions)
                        • If
                          • And
                            • Conditions
                              • Player_Forward[Temp_Int] == False
                              • Player_Backward[Temp_Int] == True
                              • Player_Left[Temp_Int] == False
                              • Player_Right[Temp_Int] == False
                        • Then
                          • Variable - Set Temp_Loc 2 = (Temp_Loc offset by 0.1 towards ((Facing of Player_Hero[Temp_Int]) - 180.0) degrees)
                          • Unit - Move Player_Hero[Temp_Int] instantly to Temp_Loc 2 (Blend)
                        • Else
                          • General - If (Conditions) then do (Actions) else do (Actions)
                            • If
                              • And
                                • Conditions
                                  • Player_Forward[Temp_Int] == True
                                  • Player_Backward[Temp_Int] == False
                                  • Player_Left[Temp_Int] == True
                                  • Player_Right[Temp_Int] == False
                            • Then
                              • Variable - Set Temp_Loc 2 = (Temp_Loc offset by 0.15 towards ((Facing of Player_Hero[Temp_Int]) + 45.0) degrees)
                              • Unit - Move Player_Hero[Temp_Int] instantly to Temp_Loc 2 (Blend)
                            • Else
                              • General - If (Conditions) then do (Actions) else do (Actions)
                                • If
                                  • And
                                    • Conditions
                                      • Player_Forward[Temp_Int] == True
                                      • Player_Backward[Temp_Int] == False
                                      • Player_Left[Temp_Int] == False
                                      • Player_Right[Temp_Int] == True
                                • Then
                                  • Variable - Set Temp_Loc 2 = (Temp_Loc offset by 0.15 towards ((Facing of Player_Hero[Temp_Int]) - 45.0) degrees)
                                  • Unit - Move Player_Hero[Temp_Int] instantly to Temp_Loc 2 (Blend)
                                • Else
          • Camera - Apply camera object Height Offset ((Height of Player_Hero[Temp_Int]) + 1.0) for player Temp_Int over 0.5 seconds with 100.0% initial velocity and 0.0% deceleration
          • Camera - Apply camera object Distance 15.0 for player Temp_Int over 0.0 seconds with 100.0% initial velocity and 0.0% deceleration
          • Camera - Apply camera object Rotation (Facing of Player_Hero[Temp_Int]) for player Temp_Int over 0.5 seconds with 100.0% initial velocity and 0.0% deceleration
          • Camera - Pan the camera for player Temp_Int to Temp_Loc over 0.5 seconds with Existing Velocity% initial velocity, 0.0% deceleration, and Do Not use smart panning
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,188
Every 0.03 seconds of Game Time
StarCraft II Galaxy virtual machine does not support timings that small... It has a resolution of 1 game frame which is about 1/10 of a second at normal speed I think (faster speeds have more game frames per real second but also advance time more than a second per real second).

As for the problem you have...
Try debugging the trigger and see what values are being used to configure the camera. A logical error might pass the camera natives values that they have no specified behaviour for.
 
Level 5
Joined
Sep 27, 2011
Messages
141
It seems that it happens when the units faces less than -90.1 but after that the camera just keeps spinning even though the unit facing does not changei dont think there is anything else in my trigger that could affect it and its nothing from other triggers.
 
Status
Not open for further replies.
Top