Announcement

Collapse
No announcement yet.

FOV change on an Object

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FOV change on an Object

    What I want to make is a jug of Moonshine. When the player picks it up it changes the FOV to 170. I'm using the touch function to do it, but it doesn't change the fov when I touch it. I'm using the DesiredFov variable that PlayerController has but it doesn't seem to work.

    Can someone point me in the right direction.

    #2
    Try adding this into your weapons inventory class:

    Code:
    var float FovLevel;
    
    function ModeTick(float deltaTime)
    {
             FovLevel = 0.60;
    	        PlayerController(Instigator.Controller).DesiredFOV = FClamp(90.0 - (ZoomLevel * 88.0), 1, 170);
    }
    Tweak all the numbers to your liking to get the effect you want.

    Comment


      #3
      isnt it something like PlayerController.SetFOV(int FOV)? I think I used that in a small experiment where the fov depended on the speed of the player.

      Comment


        #4
        I tried both ways but I keep getting an access none warning in the log.

        Comment


          #5
          When the player picks it up it changes the FOV to 170...

          Wouldn't class "Powerups" be better. You'll need to make 2 classes: powerup and pickup, but it'll free you from validating touch and other boring stuff + you'll be able to send pickup massage easily. If you want to make it this way you will get additional features like powerup expiring or pickuping this item few times adds more FOV etc. So when you'll do item this way, there will be whole State 'Active' for you and then put some code in BeginState and EndState.

          And changing FOV...
          in PressureVolume function PlayerController::SetFOVAngle() is used, which works on FOVAngle (not DesiredFOV at all). I didn't tried this, but it should work.

          Comment

          Working...
          X