Difference between revisions of "SetAlpha - Actor"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Kiriwar
m (fade to zero broken on setAlpha)
imported>Arthmoor
(→‎Notes: Added note about SetAlpha throwing an error if the actor has no AI process)
Line 33: Line 33:


The fade boolean does not work if you set the alpha to (0.0). If you wish to fade to zero, then it must be set to (0.1) and then use Utility.Wait(0.3) (or any equally small number), calling the function afterwards to set to (0.0).
The fade boolean does not work if you set the alpha to (0.0). If you wish to fade to zero, then it must be set to (0.1) and then use Utility.Wait(0.3) (or any equally small number), calling the function afterwards to set to (0.0).
This function cannot be called on a dead or disabled actor. You will get an error that the actor has no AI process.


== See Also ==
== See Also ==
*[[Actor Script]]
*[[Actor Script]]

Revision as of 04:46, 18 January 2014

Member of: Actor Script

Sets this actor's alpha value, optionally fading them to that value rather then popping.

Syntax

Function SetAlpha(float afTargetAlpha, bool abFade = false) native

Parameters

  • afTargetAlpha: The target alpha value, clamped to the 0 to 1 range. 0 is completely transparent, 1 is completely visible.
  • abFade: If true, the actor will fade over time - otherwise they will pop to the value.
    • Default: False

Return Value

None.

Examples

; Pop the ghost to half-transparent
Ghost.SetAlpha(0.5)


; Fade the ghost to mostly visible
Ghost.SetAlpha(0.9, true)

Notes

The player cannot be faded completely out and will always remain partially visible.

The fade boolean does not work if you set the alpha to (0.0). If you wish to fade to zero, then it must be set to (0.1) and then use Utility.Wait(0.3) (or any equally small number), calling the function afterwards to set to (0.0).

This function cannot be called on a dead or disabled actor. You will get an error that the actor has no AI process.

See Also