(One intermediate revision by the same user not shown)
Line 4:
Line 4:
}}
}}
{{stub}}
{{stub}}
This component creates a force field that allows the setting of or applying force to the velocity of [[Component:CharacterController|Character Controllers]].
== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|TriggersOnly|Bool|
|TriggersOnly|Bool| Whether to only allow trigger colliders attached to character controller objects to activate the force field.
|Force|Float3|
|Force|Float3|force direction and magnitude to apply a character controller within range with.
|ForceMode|'''[[#Mode|Mode]]'''|TypeAdv2=true|
|ForceMode|'''[[#Mode|Mode]]'''|TypeAdv2=true| Whether to use impulse, apply, or set velocity using <code>Force</code>
|ForceSpace|'''[[#Space|Space]]'''|TypeAdv3=true|
|ForceSpace|'''[[#Space|Space]]'''|TypeAdv3=true| Whether to do the force direction in local or global space (so should <code>Force</code> be scaled and rotated by the slot this is on or not?)
|RadialForceRadius|Float|
|RadialForceRadius|Float| The range of effect this force field has.
|ForceSlotSpace|{{RootFieldType|RootSpace}}|TypeAdv5=true| Override the transform space for <code>Force</code> with this if set.
|MinActivationVelocity|Float|
|MinActivationVelocity|Float| The minimum velocity a character controller has to be going to trigger this force field.
|MaxForceVelocity|Float|
|MaxForceVelocity|Float| How fast the character controller's velocity can be at max after being affected by this component when the user isn't holding [[Controls|Jump]]
|HoldJumpMaxForceVelocity|Float|
|HoldJumpMaxForceVelocity|Float| How fast the character controller's velocity can be at max after being affected by this component when the user is holding [[Controls|Jump]]
|PreseveDirectionAcrossPlane|Bool|
|PreseveDirectionAcrossPlane|Bool| Calculates a plane that is perpendicular to the vector <code>Force</code> (like a stick stuck into a piece of paper) and maintains the initial direction of the velocity of the character controller in either the forward or backwards facing direction of this plane.
|IgnoreParentUser|Bool|
|IgnoreParentUser|Bool| Whether to ignore the active user when finding character controllers within range of <code>RadialForceRadius</code>. This does not ignore character controllers that are simulated by the user.
|NoJumpMultiplier|Float|
|NoJumpMultiplier|Float| How much to multiply the effect of <code>Force</code> when the user isn't holding [[Controls|Jump]]
|HoldJumpMultiplier|Float|
|HoldJumpMultiplier|Float| How much to multiply the effect of <code>Force</code> when the user is holding [[Controls|Jump]]
|MaxCharacterVelocity|Float|
|MaxCharacterVelocity|Float| The maximum velocity this component can set a character controller's speed to after setting a force on it.
|MinCharacterVelocity|Float|
|MinCharacterVelocity|Float| The minimum velocity this component can set a character controller's speed to after setting a force on it.
|CharacterVelocityDampeningSpeed|Float|
|CharacterVelocityDampeningSpeed|Float| How fast to slow the user down. this can be used to give the effect of jumping into molasses.
}}
}}
== Behavior ==
== Behavior ==
Needs a collider on the same hierarchy to allow triggering this component.
Calculates a plane that is perpendicular to the vector Force (like a stick stuck into a piece of paper) and maintains the initial direction of the velocity of the character controller in either the forward or backwards facing direction of this plane.
Whether to ignore the active user when finding character controllers within range of RadialForceRadius. This does not ignore character controllers that are simulated by the user.