Component:CharacterController: Difference between revisions

From Resonite Wiki
Zandario (talk | contribs)
m Removed old Vids & Issues + Added Stubs
 
add info on rootspace
 
(14 intermediate revisions by 4 users not shown)
Line 5: Line 5:
|Name=Character Controller
|Name=Character Controller
}}
}}
== Description ==
The Character Controller component is used for user movement and simulating physics, and has many settings and values that can alter the way on how a user can control either their self or another slot (For example: Vehicles). These Settings allow you to control the mass, speed, force, etc.
{{Note|When getting the character controller of a user, avoid using the character controller under the user root slot. Instead use the node [[ProtoFlux:Find Character Controller From User|Find Character Controller From User]].|suggestion}}
Keep in mind that the character controller under the user root slot is currently useless (as in, not used besides it needing to be there) at this time. And removing it just recreates it back on the user root slot.
For this component, when using some features, you may need to either write/drive the field <code>SimulatingUser</code>. This will activate the character controller on the slot and make it start simulating. Doing this also lets you use some nodes such as [[ProtoFlux:Is Character Controller|Is Character Controller]] and [[ProtoFlux:Is Character On Ground|Is Character On Ground]], and without a simulating user, the values from some nodes would not be updated.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|SimulatingUser|User| {{stub}}
|SimulatingUser|User| The user who is currently simulating and networking this Character Controller.
|CharacterRoot|Slot| {{stub}}
|CharacterRoot|Slot| The slot to simulate
|HeadReference|Slot| {{stub}}
|HeadReference|Slot| What the Simulation uses for the capsule height
|RootAtBottom|Bool| {{stub}}
|SimulateRotation|Bool| Allow the object simulated by this object to rotate, essentially making it a rigid body. See warning.
|MassScaling|ScalingMode| {{stub}}
|MassScaling|PhysicsScalingMode|  
|ForceScaling|ScalingMode| {{stub}}
|ForceScaling|PhysicsScalingMode|  
|SpeedScaling|ScalingMode| {{stub}}
|SpeedScaling|PhysicsScalingMode|  
|JumpScaling|ScalingMode| {{stub}}
|JumpScaling|PhysicsScalingMode|  
|GravityScaling|ScalingMode| {{stub}}
|GravityScaling|PhysicsScalingMode|
|Mass|Float| {{stub}}
|LinearDamping|Float|  
|Damping|Float| {{stub}}
|AngularDamping|Float|
|Height|Float| {{stub}}
|Margin|Float|  
|Radius|Float| {{stub}}
|StepUpHeight|Float|
|Margin|Float| {{stub}}
|StepUpCheckDistance|Float|
|Speed|Float| {{stub}}
|KillVerticalVelocityAfterStepUp|Bool|
|SlidingSpeed|Float| {{stub}}
|EdgeDetectionDepth|Float|
|AirSpeed|Float| {{stub}}
|Speed|Float|  
|TractionForce|Float| {{stub}}
|SlidingSpeed|Float|  
|SlidingForce|Float| {{stub}}
|AirSpeed|Float|  
|AirForce|Float| {{stub}}
|TractionForce|Float| How much force is needed to overcome standing friction.
|MaximumGlueForce|Float| {{stub}}
|SlidingForce|Float| How much friction force is applied while the CharacterController is moving.
|MaximumTractionSlope|Float| {{stub}}
|AirForce|Float|  
|MaximumSupportSlope|Float| {{stub}}
|MaximumGlueForce|Float|  
|JumpSpeed|Float| {{stub}}
|MaximumTractionSlope|Float| Maximum Traction angle (degrees) before user slides down a slope, even if they are actively trying to walk up it.
|SlidingJumpSpeed|Float| {{stub}}
|MaximumSupportSlope|Float| Maximum Support angle (degrees) before user slides down a slope, when not working against the slope.
|Gravity|Float3| {{stub}}
|JumpSpeed|Float|  
|LocalSpace|Slot|
|SlidingJumpSpeed|Float|  
|UseParentSpace|Bool| {{stub}}
|Gravity|Float3| Force of Gravity for this character controller
|OverrideRootSpace|RootSpace| {{stub}}
|GravitySpace|{{RootFieldType|RootSpace}}|TypeAdv28=true| The coordinate space in which <code>Gravity</code> is applied in. applying gravity to world space using this field, can allow a user to stay upright despite a floor they're parented under is being rotated. which generates interesting effects.
|CollideWithOtherCharacters|Bool| {{stub}}
|DebugVisualDuration|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float|Float]]&gt;'''|TypeAdv29=true| Allows for the component to visualize the force vectors acting on the character simulator if set above 0.
|IgnoreRaycasts|Bool| {{stub}}
|__height|Float| Height of the driven [[CapsuleCollider (Component)]] Currently does nothing.
|__radius|Float| Radius of the driven [[CapsuleCollider (Component)]] Currently does nothing.
|__mass|Float| Mass of the of the driven [[CapsuleCollider (Component)]] Currently does nothing.
|__collideWithOtherCharacters|Bool| Currently does nothing.
|__ignoreRaycasts|Bool| Currently does nothing.
|__rootAtBottom|Bool| Currently does nothing.
}}
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
This component is usually used internally by Resonite to simulate user movement physics like walking and climbing.
But the component can also be manipulated to create "Fake Players" commonly known by Resonite users as "NPC's". Before doing this, know that the physics simulation is always inconsistent when viewed by different players in the same session. It also causes high amounts of networking and FPS lag. Use too many and you may start rising in [[Queued Packets]]. The character controller can also be used as a ball, but for things that fly or bounce, using a [[ProtoFlux:Trajectory Position| Trajectory Position]] ProtoFlux node is vastly superior.
This component is also used in certain types of vehicles and making them controllable by the user. This is done by having a vehicle you want to make controllable, then making an anchor for the user to sit in, then setting up this component to make that user become the simulating user, thus making their controls change in such a way where they are controlling a vehicle they are sitting on.
{{stub}}
{{stub}}


<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
{{stub}}
 
A Shrike NPC running around the cloud home:
 
[[File:Example_Of_A_CharacterController_NPC.webp|200px|A 4 foot tall Avali NPC with the likeness of a user named Shrike, running in the Resonite Default Cloud Home. It is set to Nighttime and the NPC is near the Reading Nook running towards it.]]
<br>


[[Category:ComponentStubs]]
[[Category:ComponentStubs]]
[[Category:Components|Character Controller]]
[[Category:Components:Physics{{#translation:}}|Character Controller]]
[[Category:Components:Physics|Character Controller]]
[[Category:Components{{#translation:}}|Character Controller]]
 
== Protoflux Notes ==
 
Using [[ProtoFlux:Character Controller User|Character Controller User]] will give you the Simulating User of this Character Controller Component.
 
Using [[ProtoFlux:Get User From Component|Get User From Component]] will give you the Owner User of this Character Controller Component.
 
Using [[ProtoFlux:Allocating User|Allocating User]] will give you the User that spawned out a slot that has this Character Controller Component.

Latest revision as of 17:27, 23 October 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
Character Controller component as seen in the Scene Inspector


Description

The Character Controller component is used for user movement and simulating physics, and has many settings and values that can alter the way on how a user can control either their self or another slot (For example: Vehicles). These Settings allow you to control the mass, speed, force, etc.

When getting the character controller of a user, avoid using the character controller under the user root slot. Instead use the node Find Character Controller From User.

Keep in mind that the character controller under the user root slot is currently useless (as in, not used besides it needing to be there) at this time. And removing it just recreates it back on the user root slot.

For this component, when using some features, you may need to either write/drive the field SimulatingUser. This will activate the character controller on the slot and make it start simulating. Doing this also lets you use some nodes such as Is Character Controller and Is Character On Ground, and without a simulating user, the values from some nodes would not be updated.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
SimulatingUser User The user who is currently simulating and networking this Character Controller.
CharacterRoot Slot The slot to simulate
HeadReference Slot What the Simulation uses for the capsule height
SimulateRotation Bool Allow the object simulated by this object to rotate, essentially making it a rigid body. See warning.
MassScaling PhysicsScalingMode
ForceScaling PhysicsScalingMode
SpeedScaling PhysicsScalingMode
JumpScaling PhysicsScalingMode
GravityScaling PhysicsScalingMode
LinearDamping Float
AngularDamping Float
Margin Float
StepUpHeight Float
StepUpCheckDistance Float
KillVerticalVelocityAfterStepUp Bool
EdgeDetectionDepth Float
Speed Float
SlidingSpeed Float
AirSpeed Float
TractionForce Float How much force is needed to overcome standing friction.
SlidingForce Float How much friction force is applied while the CharacterController is moving.
AirForce Float
MaximumGlueForce Float
MaximumTractionSlope Float Maximum Traction angle (degrees) before user slides down a slope, even if they are actively trying to walk up it.
MaximumSupportSlope Float Maximum Support angle (degrees) before user slides down a slope, when not working against the slope.
JumpSpeed Float
SlidingJumpSpeed Float
Gravity Float3 Force of Gravity for this character controller
GravitySpace direct RootSpace The coordinate space in which Gravity is applied in. applying gravity to world space using this field, can allow a user to stay upright despite a floor they're parented under is being rotated. which generates interesting effects.
DebugVisualDuration Nullable`1<Float> Allows for the component to visualize the force vectors acting on the character simulator if set above 0.
__height Float Height of the driven CapsuleCollider (Component) Currently does nothing.
__radius Float Radius of the driven CapsuleCollider (Component) Currently does nothing.
__mass Float Mass of the of the driven CapsuleCollider (Component) Currently does nothing.
__collideWithOtherCharacters Bool Currently does nothing.
__ignoreRaycasts Bool Currently does nothing.
__rootAtBottom Bool Currently does nothing.

Usage

This component is usually used internally by Resonite to simulate user movement physics like walking and climbing.

But the component can also be manipulated to create "Fake Players" commonly known by Resonite users as "NPC's". Before doing this, know that the physics simulation is always inconsistent when viewed by different players in the same session. It also causes high amounts of networking and FPS lag. Use too many and you may start rising in Queued Packets. The character controller can also be used as a ball, but for things that fly or bounce, using a Trajectory Position ProtoFlux node is vastly superior.

This component is also used in certain types of vehicles and making them controllable by the user. This is done by having a vehicle you want to make controllable, then making an anchor for the user to sit in, then setting up this component to make that user become the simulating user, thus making their controls change in such a way where they are controlling a vehicle they are sitting on.

This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Examples

A Shrike NPC running around the cloud home:

A 4 foot tall Avali NPC with the likeness of a user named Shrike, running in the Resonite Default Cloud Home. It is set to Nighttime and the NPC is near the Reading Nook running towards it.

Protoflux Notes

Using Character Controller User will give you the Simulating User of this Character Controller Component.

Using Get User From Component will give you the Owner User of this Character Controller Component.

Using Allocating User will give you the User that spawned out a slot that has this Character Controller Component.