Skip to content

Netcode tutorial should include this: #16

Description

@shitoudev67

Netcode tutorial is missing these 2:

[CreateBefore(typeof(Unity.NetCode.TransformDefaultVariantSystem))]
public partial class DefaultVariantSystem : DefaultVariantSystemBase
{
protected override void RegisterDefaultVariants(Dictionary<ComponentType, Rule> defaultVariants)
{
defaultVariants.Add(typeof(LocalTransform), Rule.ForAll(typeof(DontSerializeVariant)));
defaultVariants.Add(typeof(KinematicCharacterBody),
Rule.ForAll(typeof(KinematicCharacterBody_GhostVariant)));
}
}

[GhostComponentVariation(typeof(KinematicCharacterBody))]
[GhostComponent(SendTypeOptimization = GhostSendType.OnlyPredictedClients)]
public struct KinematicCharacterBody_GhostVariant
{
[GhostField(Quantization = 1000)] public float3 RelativeVelocity;
[GhostField()] public bool IsGrounded;
}

Took me days to figure out why my jumps were jittery, these 2 lines of code from the online fps sample solved it for me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions