SyncPlayer
Jump To Parameters
Jump To Function Definitions
Parameter Definitions
Select the parameter name from below to jump directly to it on this page.
_positionLerpRate
_rotationLerpRate
_syncAnimations
itemDict
teamName
_positionLerpRate
How fast to move to the new position when the networked equivalent of this player receives an update from the server. High values will ‘snap’ to position, while too low values will feel sluggish or unresponsive. This is something to play with until you get right.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 5.0f |
_rotationLerpRate
How fast to move to the new rotation when the networked equivalent of this player receives an update from the server. High values will ‘snap’ to position, while too low values will feel sluggish or unresponsive. This is something to play with until you get right.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 5.0f |
_syncAnimations
This will sync the bone positions. Makes it so players on the network can see where this player is looking.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | bool | true |
itemDict
Hidden variable. The item dictionary of the player. This is used to save it to the
PlayerData.
| Exposed Value | Type | Default Value |
|---|---|---|
| None | GameObject> | new Dictionary<int, GameObject>() |
teamName
The name of the team you’re currently on. Set this by calling "SetTeamName" function on the “
NetworkManager component.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | string | ”” |
Function Definitions
Select the function name from below to jump directly to it on this page.
Awake
BuildAnimatorParamsDict
BuildItemDictionary
DeadEnableDeathCam
EnableDeathCamera
EnableSendingAnimations
EnableSendingPosRot
EnterLadder
ExitLadder
GetArrowId
Jump
ModifyHitTags
NetworkActiveRagdoll
NetworkDisableRagdoll
OnDropItem
OnReceiveDamage
Respawn
Respawn
SetBodyPart
SetBodyParts
SetBoneSettings
SetLayer
SetTags
Start
Update
protected virtual void Awake()
Sets the
itemDatavariable and disables the enable switching on the death camera by calling theEnableSwitchingfunction.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void BuildAnimatorParamsDict()
Populates the
animParamsvariable which is used to know what animator parameters to watch and send updates over the network for. Calls viaStartfunction.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void BuildItemDictionary()
Populates the
itemDictparameter so when an item is equipped/unequipped it will know the GameObject to spawn based on that items Id.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
public virtual void DeadEnableDeathCam(GameObject temp = null)
Turn on the death camera by calling
EnableDeathCamerawith a true value.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| temp | Placed here for UnityEvent activation. Otherwise not used. |
public virtual void EnableDeathCamera(bool isEnabled)
Allows/Disallows switching on the
DeathCameracomponent by callingEnableSwitchingwith the specified value.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| isEnabled | bool type, allow switching the camera or not. |
public virtual void EnableSendingAnimations(bool isEnabled)
Make it so the owner player can send his animation parameters over the network. The network players will set their animation parameters based on what they recieve from the owner player.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| isEnabled | bool type, allow the owner player to send their animator parameters |
public virtual void EnableSendingPosRot(bool isEnabled)
Send the position and rotation of the owner player over the network so the network players will set their position and rotation based on what they receive.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| isEnabled | bool type, allow sending the position and rotation over the network? |
public virtual void EnterLadder()
Makes the networked players play the enter ladder animation.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
public virtual void ExitLadder()
Makes the networked players play the exit ladder animation
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
public virtual int GetArrowId()
Returns the id that the next arrow should use.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | The arrow id to use |
No parameters
public virtual void Jump()
Makes the other networked players jump in response to this owners command. Meant to be used with the OnJump UnityEvent in the
vThirdPersonController.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
protected virtual void ModifyHitTags()
Make sure the network versions allowed to hit the
PlayerLayer and tag and the owner player is NOT allowed to hit thePlayerLayer and tag. These settings are set in thevMeleeManagercomponent. Called viaStart.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
public virtual void NetworkActiveRagdoll(vDamage damage = null)
Turns on ragdoll effects for the networked players.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| damage | Placed here to be used with UnityEvents, otherwise not used. |
protected virtual void NetworkDisableRagdoll()
Turns off ragdoll effects for the networked players.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
public virtual void OnDropItem(vItem item, int value)
Makes all network players drop and item with the specified amount. Also Send a drop command to the data channel on the
Chatboxso when other players enter this unity scene that item is dropped for their version of the game as well.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| item | vItem type, the item to drop |
| value | int type, the amount of this item to drop |
public virtual void OnReceiveDamage(vDamage damage)
Used to set the damage to zero if the sender is on the same team and you disallow team damaging. This function is meant to be called by the OnReceiveDamage unityevent on the
vThirdPersonController. If damage is received then it is replicated to all networked players
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| damage | *No found decription |
public virtual void Respawn()
Calls the
Respawnfunction with a null gameobject
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
No parameters
public virtual void Respawn(GameObject go)
Calls the
SavePlayerfunction in the network manager and also calls theRespawnfunction on thePlayerRespawncomponent.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| go | Placed here for calling with UnityEvents. Otherwise not used. |
protected virtual void SetBodyPart(Transform target = null, bool isTrigger = true)
Used by the
SetBodyPartsfunction. Will set the target transform to enable or disable it’s trigger if it has one.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| target | Transform type, the transform to target |
| isTrigger | bool type, enable or disable the trigger. |
protected virtual IEnumerator SetBodyParts(bool isTrigger)
Turns the triggers on/off for the body parts of the player based on the input value. Will wait for the bones to be assigned in the avatar before continueing. This makes this work with UMA characters a little better.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| isTrigger | bool type, enable the triggers for all the body parts? |
protected virtual IEnumerator SetBoneSettings()
This is a way to wait until the bones on the avatar are assigned before attempting to access them. This is designed to work a little better with UMA characters. Calls the SetLayer and SetTags functions.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void SetLayer()
Set the layers to the none owner layers.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void SetTags(Transform target)
Sets the tags to be the none owner tags on all transforms of this object.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
| Parameter Name | Description |
|---|---|
| target | *No found decription |
protected virtual void Start()
Builds the item dictionary used to spawn weapons over the network based on the weaponds id. Also disables/enables a series of components on this player if you’re a networked player of the owner player. Disables the death camera and builds the animator parameters to sync over the network. Also sets the layers and tags of the player via the
SetLayerandSetTagsfunctions. Finally enables/disables the triggers on the body parts via theSetBodyPartsfunction.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters
protected virtual void Update()
Sets the networked players position/rotation based on the received values from the owner player. Also is responsible for playing the “Roll” animation if the owner player enters the roll state. Finally checks if the owner has entered a ragdoll stat, if so enables/disables ragdoll for the networked player based on the setting the owner currently is in. This is also responsible for showing or hiding the cursor if the inventory is open or not.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | True | Does not return anything |
No parameters