ViewBob

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

ViewBob

Post by Logan MTM »

Hi everyone!

There is a way to change the Player.ViewBob?

Something like this:

SetActorProperty(0, APROP_ViewBob, 0.1)

I mean, i can change Player.Viewheight with SetActorProperty(0, APROP_ViewHeight...
What about "APROP_ViewBob" for Player.ViewBob ?
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: ViewBob

Post by Player701 »

It can be accessed directly via ZScript, but not in ACS.

For example, this inventory item will change the player's ViewBob to 0.1 upon pickup (note that ViewBob is defined for PlayerPawn so you have to cast toucher to PlayerPawn first):

Code: Select all

class TestInv : Inventory
{
    override bool TryPickup(in out Actor toucher)
    {
        let pp = PlayerPawn(toucher);
        
        if (pp != null)
        {
            pp.ViewBob = 0.1;
        }
        
        GoAwayAndDie();
        return true;
    }
}
If you need to do this from ACS, see ScriptCall.
User avatar
Logan MTM
Posts: 678
Joined: Mon Jan 16, 2006 8:53 pm
Location: Rio de Janeiro - Brazil

Re: ViewBob

Post by Logan MTM »

Zscript? :blergh:
Thanks for the tip :D
Post Reply

Return to “Scripting”