Camera below terrain level

Status
Not open for further replies.
Level 6
Joined
Sep 28, 2009
Messages
222
just check in a periodic trigger if the camera pitch is < 5, if yes set it to 6. like this i made it.

i hate periodic triggers but as far i know its the only possibility, since there is no event that reacts on camera properties. the other possibility is the event "<player> moves the camera for <any>" but since all players are moving the camera all the time this might be even more bad for the performence then a periodic trigger.
 
Level 8
Joined
Jun 20, 2004
Messages
229
thats still not going to fix it from going underneath the ground...

what you have to do is form a right triangle using your AoA and the camera distance from your character. once you have the point found, you must get the camera height and then subtract the height of that point and then form a 2nd triangle using that and the distance to target. after that it should get you the angle you need for your AoA or pitch.

i dont know if you understood any of this... but you will need to know how sin cos and sin work and the sides of a triangle.
 
Incase you meant that the current Timer/PeriodicEvent minimum interval is too long:

If I remember correctly somewhere someone said that the minimum value of Wait(0.0) is lower than that of Timer(0.0) or PeriodicEvent(0.0). If that's true then how about doing like this.

Events
- Map Initialization
Actions
- Loop(Forever)
- - If (Player 1 camera pitch < 5) then
- - - Set Player 1 camera pitch to 6.
- - Endif
- - Wait(0.0)
- Endloop
 
Level 9
Joined
Sep 28, 2004
Messages
365
Solved.

To all those who want to know how it works.. Here is my trigger:
  • Minimum Height
    • Events
      • Timer - Every 0.1 seconds of Game Time
    • Local Variables
    • Conditions
      • Or
        • Conditions
          • (Camera Pitch of Player(1)) <= 5.0
          • (Camera Pitch of Player(1)) >= 300.0
    • Actions
      • Camera - Apply camera object Angle Of Attack 5.5 for player 1 over 0.5 seconds with Existing Velocity% initial velocity and 10% deceleration
Once below ground, the pitch of camera will be starting from 359. So detecting both side is needed just incase someone push the mouse up too fast. Also +Rep to Mille25 for hinting that angle of attack [:
 
Level 3
Joined
Apr 28, 2010
Messages
48
Incase you meant that the current Timer/PeriodicEvent minimum interval is too long:

If I remember correctly somewhere someone said that the minimum value of Wait(0.0) is lower than that of Timer(0.0) or PeriodicEvent(0.0). If that's true then how about doing like this.

Events
- Map Initialization
Actions
- Loop(Forever)
- - If (Player 1 camera pitch < 5) then
- - - Set Player 1 camera pitch to 6.
- - Endif
- - Wait(0.0)
- Endloop

Wouldn't it be better just to set it at 5, with <= 5? You could also use the smooth camera for this I think.

I mean snapping isn't really a delightful thing to have going on.
 
Status
Not open for further replies.
Top