First Person View

ShadowSnipe4

New Member
Reaction score
4
Heres what Im trying to do:
I am trying to make a first person map where one team is humans and one is aliens and you move your respective units using the arrow keys and attakc using a letter. MY problem is that I cant get the camera to stay facing foward along with the unit as it turns etc. How do I make it so that the camera follows my units perspective?
 
R

Razthemapper

Guest
World Editor Unlimited allows you to do all this in ONE trigger... just a suggestion
 

PB_and_J

level 85 anti-spammer
Reaction score
41
try ceching the free trigger thread:)
 

ShadowSnipe4

New Member
Reaction score
4
I already looked at the free trigger thread and saw what that one guy did. Thats not what i want to do. As for the lock camera target to unit, I already did that but I want it so that when the unit turns the camera turns with it.
 
H

Heptameron

Guest
ShadowSnipe4 said:
I already looked at the free trigger thread and saw what that one guy did. Thats not what i want to do. As for the lock camera target to unit, I already did that but I want it so that when the unit turns the camera turns with it.
You have to use a periodic trigger with a duration of about 0.03 seconds. You just set the angle of the camera to the angle of the unit.
 
H

Heptameron

Guest
ShadowSnipe4 said:
How would I do that?
:banghead:
Code:
Camera Angle
    Events
        Time - Every 0.03 seconds
    Conditions
    Actions
        Camera - Set Angle of current camera to (Facing of [i]<unit>[/i])
Something like that, I'm not in the editor now.
 

ShadowSnipe4

New Member
Reaction score
4
I just realized that the movement by keyboard triggers that I had will always go the same direction no matter where the guy is facing, is there a way to make the directions in the units perspective also?
 
H

Heptameron

Guest
ShadowSnipe4 said:
I just realized that the movement by keyboard triggers that I had will always go the same direction no matter where the guy is facing, is there a way to make the directions in the units perspective also?
Assuming you're using polar projections, try adding/subtracting the facing of the unit to the angle of the projection.
 
H

Heptameron

Guest
ShadowSnipe4 said:
Also, is there a condition for player is pressing Up arrow on keyboard, or is it only an event?
Only an event. Why?
 

ShadowSnipe4

New Member
Reaction score
4
Because, when Im having the unit move, it has it as an event that the button is pressed meaning it runs only when the button is pressed and since i have many obstructions in the way of his moving I wanted to have ti so that he moves pretty close to them instead of trying to go around them. So I set the distance low. But now that the distance is low, he moves then stops and moves again only if you press the keyboard periodically instead of holding it down like I want.
 

ShadowSnipe4

New Member
Reaction score
4
Forgot to mention this in the post i just made. What I want is haivng the trigger run every .01 seconds or so, and having a condition so that the trigger wont go unless the button is held down.
 
H

Heptameron

Guest
In that case, you can try a different method. Have a boolean variable for each direction. Have a periodic trigger check the variable and if it is true, order the unit to move in a certain direction. Then set the boolean variable to true when the button is pressed and false when it's released.
 

ShadowSnipe4

New Member
Reaction score
4
Now hes not moving at all, heres the trigger, can you tell me what I did wrong?
Code:
Press Up
    Events
        Player - Player 1 (Red) Presses the Up Arrow key
    Conditions
    Actions
        Set UP = 1
Code:
Up Check
    Events
        Time - Every 0.01 seconds of game time
    Conditions
        UP Equal to 1
    Actions
        Trigger - Run Go Up <gen> (ignoring conditions)
Code:
Release UP
    Events
        Player - Player 1 (Red) Releases the Up Arrow key
    Conditions
    Actions
        Set UP = 0
Code:
Go Up
    Events
    Conditions
    Actions
        If (UP Equal to 0) then do (Unit - Order Crew Member 0019 <gen> to Move To ((Position of Crew Member 0019 <gen>) offset by 300.00 towards (Facing of Crew Member 0019 <gen>) degrees)) else do (Do nothing)
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Ok, Ace was faster thatn me...

Here is it higlighted anyway
ShadowSnipe4 said:
Code:
Up Check
    Events
        Time - Every 0.01 seconds of game time
    Conditions
        [B]UP Equal to 1[/B]
    Actions
        Trigger - Run Go Up <gen> (ignoring conditions)
Code:
Go Up
    Events
    Conditions
    Actions
        If ([B]UP Equal to 0[/B]) then do (Unit - Order Crew Member 0019 <gen> to Move To ((Position of Crew Member 0019 <gen>) offset by 300.00 towards (Facing of Crew Member 0019 <gen>) degrees)) else do (Do nothing)
 
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