Component:CharacterTeleporter: Difference between revisions

From Resonite Wiki
imported>Xekri
No edit summary
 
add info, no longer stub
 
(4 intermediate revisions by 3 users not shown)
Line 8: Line 8:
}}
}}


The '''CharacterTeleporter''' sets up a Slot to teleport a character to the associated teleport exit when the Slot's Collider is hit. The Collider must be of type Trigger.
The '''CharacterTeleporter''' sets up a Slot to teleport a character to the associated teleport exit when the Slot's Collider is hit. The Collider must be of type Trigger unless <code>TriggersOnly</code> is disabled.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Exits|SyncList`1|TypeString0=SyncList<Exit>|
|TriggersOnly|Bool| Whether to only allow triggers in this component's slot hiearchy to trigger the teleporter.
|MinimumVelocity|Float|
|Exits|{{RootFieldType|SyncList`1|[[#Exit|Exit]]}}|TypeAdv1=true| A list of slot exits to send the user to, which include rotation and individualized data.
|DirectionReference|Float3|
|MinimumVelocity|Float| the minimum velocity the user has to be traveling to enter the teleporter.
|MaxDirectionAngle|Float|
|DirectionReference|Float3| Which way is looking forward for this teleporter.
|IgnoreParentUser|Bool|
|MaxDirectionAngle|Float| If the user's velocity direction has an angle greater than this compared to the <code>DirectionReference</code>, then don't teleport the user.
|TeleportEntered|SyncDelegateList`1|TypeString5=SyncDelegateList<Action<float3>>|
|IgnoreParentUser|Bool| Whether to ignore the active user of this component when finding users that meet the criteria to go through the teleporter.
|TeleportExited|SyncDelegateList`1|TypeString6=SyncDelegateList<Action<float3>>|
|TeleportEntered|{{RootFieldType|SyncDelegateList`1|[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;}}|TypeAdv6=true| [[Sync Delegate|Sync Delegates]] that take [[Type:Float3|Float3]] that should be called when the teleporter is entered.
|TeleportExited|{{RootFieldType|SyncDelegateList`1|[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;}}|TypeAdv7=true| [[Sync Delegate|Sync Delegates]] that take [[Type:Float3|Float3]] that should be called when the teleporter is exited anywhere.
}}
}}
== Exit ==
{{Table TypeFields
|Weight|Float| The probability of coming out of this exit.
|TeleportExit|Slot| The slot this exit will send the user to when this exit is chosen.
|ParentAfterTeleport|Bool| Whether to parent the character controller slot under <code>TeleportExit</code>
|TransformRotation|Bool| Whether to rotate the user to align this user to be pointing the same direction relative to this as they were pointing relative to the entrance.
|TransformScale|Bool| Whether to scale the character controller to <code>TeleportExit</code>'s scale relative to the entrance.
|RelativeExitPoint|Bool| Whether this exit will put the user at the same relative position to it as the user was when they went into the entrance.
|RandomExitPointGenerator|IPointGenerator| A generator for points the user should end up when exiting out of this exit. for example, teleporting users into a [[Component:CirclePointGenerator|circle area]] after they exit here. Only works if <code>RelativeExitPoint</code> is false.
|TeleportExitVelocity|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Float3|Float3]]&gt;'''|TypeAdv7=true| What velocity to set the user to when they exit out of this exit.
|TeleportExited|{{RootFieldType|SyncDelegateList`1|[[Type:Action`1|Action`1]]&lt;[[Type:Float3|Float3]]&gt;}}|TypeAdv8=true| [[Sync Delegate|Sync Delegates]] that take [[Type:Float3|Float3]] that should be called when the teleporter is exited here.
}}


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
Place the component on a slot with a collider that has character collider field enabled. Next, specify slot(s) for the user to exit out of in the <code>Exits</code> list. Walking into the collider zone will send you and anyone else to the target [[#Exit|Exit]]


<!--T:4-->
<!--T:4-->
== Examples ==
== Examples ==
Can be used in conjunction with a [[Component:CameraPortal|Camera Portal]] to make a gateway/portal. It can also be used to make a Tardis interior.


* [https://www.youtube.com/watch?v=vPj43dD8CQ4 Teleport users using CharacterTeleporter] by [[User:ProbablePrime|ProbablePrime]]
* [https://www.youtube.com/watch?v=vPj43dD8CQ4 Teleport users using CharacterTeleporter] by [[User:ProbablePrime|ProbablePrime]]
Line 32: Line 49:
<!--T:5-->
<!--T:5-->
== Related Components ==
== Related Components ==
* [[Component:RandomObjectSpawner|RandomObjectSpawner]]
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Character Teleporter]]
[[Category:Components{{#translation:}}|Character Teleporter]]
[[Category:Components With Nested Types{{#translation:}}|Character Teleporter]]
[[Category:Components:Locomotion:Interaction{{#translation:}}|Character Teleporter]]
[[Category:Components:Locomotion:Interaction{{#translation:}}|Character Teleporter]]

Latest revision as of 18:47, 19 October 2024


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


Component image 
Character Teleporter component as seen in the Scene Inspector


The CharacterTeleporter sets up a Slot to teleport a character to the associated teleport exit when the Slot's Collider is hit. The Collider must be of type Trigger unless TriggersOnly is disabled.

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.
TriggersOnly Bool Whether to only allow triggers in this component's slot hiearchy to trigger the teleporter.
Exits list of Exit A list of slot exits to send the user to, which include rotation and individualized data.
MinimumVelocity Float the minimum velocity the user has to be traveling to enter the teleporter.
DirectionReference Float3 Which way is looking forward for this teleporter.
MaxDirectionAngle Float If the user's velocity direction has an angle greater than this compared to the DirectionReference, then don't teleport the user.
IgnoreParentUser Bool Whether to ignore the active user of this component when finding users that meet the criteria to go through the teleporter.
TeleportEntered direct SyncDelegateList`1<Action`1<Float3>> Sync Delegates that take Float3 that should be called when the teleporter is entered.
TeleportExited direct SyncDelegateList`1<Action`1<Float3>> Sync Delegates that take Float3 that should be called when the teleporter is exited anywhere.

Exit

Fields
Name Type Description
Weight Float The probability of coming out of this exit.
TeleportExit Slot The slot this exit will send the user to when this exit is chosen.
ParentAfterTeleport Bool Whether to parent the character controller slot under TeleportExit
TransformRotation Bool Whether to rotate the user to align this user to be pointing the same direction relative to this as they were pointing relative to the entrance.
TransformScale Bool Whether to scale the character controller to TeleportExit's scale relative to the entrance.
RelativeExitPoint Bool Whether this exit will put the user at the same relative position to it as the user was when they went into the entrance.
RandomExitPointGenerator IPointGenerator A generator for points the user should end up when exiting out of this exit. for example, teleporting users into a circle area after they exit here. Only works if RelativeExitPoint is false.
TeleportExitVelocity Nullable`1<Float3> What velocity to set the user to when they exit out of this exit.
TeleportExited direct SyncDelegateList`1<Action`1<Float3>> Sync Delegates that take Float3 that should be called when the teleporter is exited here.


Usage

Place the component on a slot with a collider that has character collider field enabled. Next, specify slot(s) for the user to exit out of in the Exits list. Walking into the collider zone will send you and anyone else to the target Exit

Examples

Can be used in conjunction with a Camera Portal to make a gateway/portal. It can also be used to make a Tardis interior.

Related Components