Libraries

s&box libraries

Shrimple Pawns

fish.sp

The classic entity pawn system... but in scene!

About

Shrimple Pawns
"no we won't allow pawn games" -garry

s&box library that provides support for the classic entity Pawn system. This is useful in cases where the player can take control of different controllers. For example, an FPS game where you have the regular player state but also a spectating state.

Example
// Inherit the pawn component.
//
// Make sure to provide the PawnAttribute with a path to a prefab
// if you decide to use the template version of AssignPawn.
[Pawn( "spectate.prefab" )]
public sealed class SpectatePawn : Pawn
{

}then assign the pawn to the client!
// All of the following code should be called on the host! Since we use [HostSync] internally.
//
// Setup and assign the client a connection. Make sure this clientObj is already networked and has a client component attached.
var client = clientObj.Components.Get<Client>();
client.AssignConnection( channel );

// Give the client a pawn via one of the methods below.

// Option #1
// The pawn component MUST have PawnAttribute.
client.AssignPawn<SpectatePawn>();

// Option #2
// The pawn component does NOT need PawnAttribute in this case.
client.AssignPawn(SpectatePrefab);

// Option #3
// The gameobject already exists and you want to assign it
var obj = SceneUtility.GetPrefabScene( SpectatePrefab ).Clone();
client.AssignPawn(obj);
A full example can be viewed here.

shrimplepawnpawns

More by Small Fish

01
Shrimple Character Controller thumbnail

A shrimple yet versatile character controller/move helper that performs great

controllercharactermovementwalkerflyer
+0 24h
23favorites
25upvotes
81%Wilson score
02
Shrimple Ragdolls thumbnail
Shrimple Ragdolls fish.shrimple_ragdolls

Every type of ragdoll you might need

activemotorpassiveragdollragdolls
+0 24h
15favorites
13upvotes
77%Wilson score
03
Boxfish thumbnail
Boxfish fish.boxfish

a shrimple and abstract voxel library

fishlibrarytoolvoxel
+0 24h
11favorites
14upvotes
70%Wilson score
04
Conchplex Particle Emitters thumbnail
Conchplex Particle Emitters fish.conchplexemitters

Sphere, Box and Ring emitters, with additional functionality and more easier to understand property names and layout.

particleparticles
+0 24h
1favorites
2upvotes
34%Wilson score
05
ShrimpleProfiler thumbnail
ShrimpleProfiler fish.shrimpleprofiler

A shrimple profiler for your gamemode!

shrimpleprofilermitsimpleprofile
+0 24h
1favorites
0upvotes
0%Wilson score
06
Small Fish Utils thumbnail
Small Fish Utils fish.sfu

Common functionality used across Small Fish games

utilityutilsfunctionshelpfulsmall
+0 24h
0favorites
1upvotes
9%Wilson score