SbTween/Examples/SbeNetworkTest.cs

A Sandbox component example that starts a networked tween when the entity starts. It defines a Vector3 property 'location' and, on start, if this instance is not a proxy it runs a looping move tween to that location using linear easing and a YoYo loop.

using Sandbox;
using SbTween;

namespace SbTween.Examples;

public sealed class SbeNetworkTest : Component
{
	[Property] public Vector3 location;


	[Rpc.Broadcast]
	protected override void OnStart()
	{
		if ( !IsProxy )
		{
			this.TweenMove( location, 1 ).SetEase( EaseType.Linear ).SetLoops( -1, LoopType.YoYo ).Play();
		}
	}
}