reckfellENGINE

SpringArm3D

A 3D raycast that dynamically moves its children near the collision point.

On this page
class SpringArm3DReckfellSharpInherits Entity3D

A 3D raycast that dynamically moves its children near the collision point.

SpringArm3D casts a ray or a shape along its Z axis and moves all its direct children to the collision point, with an optional margin. This is useful for 3rd person cameras that move closer to the player when inside a tight space (you may need to exclude the player's collider from the SpringArm3D's collision check).

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

SpringArm3DConstructor
# SpringArm3D
C#
public SpringArm3D();

Properties4

CollisionMaskProperty
# CollisionMask
C#
public uint CollisionMask { get; set; }

Physics-layer bits matched by the obstacle query. A value of 1 matches the first layer; 0 matches none. Unrelated to camera render layers. Exclude the character body separately using its physics RID.

MarginProperty
# Margin
C#
public float Margin { get; set; }

Hit-distance offset for the ray-cast branch only. The verified version does not subtract it for an explicit Shape or the automatic shape of a direct Camera3D child. Choose suitable shape dimensions; Margin is not universal camera clearance.

ShapeProperty
# Shape
C#
public Shape3D Shape { get; set; }

Obstacle query shape. If null with a direct Camera3D child, the camera supplies an automatic shape; without that child, the query uses a ray. The verified explicit-shape branch does not subtract Margin. Changes take effect on a physics update.

SpringLengthProperty
# SpringLength
C#
public float SpringLength { get; set; }

Requested cast length along local +Z transformed by the global basis, not the collision-shortened distance. Keep the hierarchy scale at one for predictable units. GetHitLength reads the last physics result.

Methods12

AddExcludedObjectvoid
# AddExcludedObject
C#
public void AddExcludedObject(Rid rID);

Excludes a physics object from spring queries. Pass body.GetRid() for the character so it does not shorten its own camera arm. This does not disable the body’s own collisions.

Parameters
NameTypeDefault
rIDRid—
rID

Physics-body RID obtained through GetRid(), not an entity instance ID or mesh RID.

ClearExcludedObjectsvoid
# ClearExcludedObjects
C#
public void ClearExcludedObjects();

Clears the list of PhysicsBody3D objects excluded from the collision check.

GetCollisionMaskuint
# GetCollisionMask
C#
public uint GetCollisionMask();
Returns uint
GetHitLengthfloat
# GetHitLength
C#
public float GetHitLength();

Returns the distance calculated on the last physics update. Changing SpringLength or Shape does not recalculate it immediately. All direct Entity3D children are moved to that distance, not just the camera.

Returns float

Last calculated length, equal to SpringLength when no matching obstacle is hit. Wait for the first physics update before relying on this result.

GetLengthfloat
# GetLength
C#
public float GetLength();
Returns float
GetMarginfloat
# GetMargin
C#
public float GetMargin();
Returns float
GetShapeShape3D
# GetShape
C#
public Shape3D GetShape();
Returns Shape3D
RemoveExcludedObjectbool
# RemoveExcludedObject
C#
public bool RemoveExcludedObject(Rid rID);

Removes the given Rid from the list of PhysicsBody3D objects excluded from the collision check.

Parameters
NameTypeDefault
rIDRid—
Returns bool
SetCollisionMaskvoid
# SetCollisionMask
C#
public void SetCollisionMask(uint mask);
Parameters
NameTypeDefault
maskuint—
SetLengthvoid
# SetLength
C#
public void SetLength(float length);
Parameters
NameTypeDefault
lengthfloat—
SetMarginvoid
# SetMargin
C#
public void SetMargin(float margin);
Parameters
NameTypeDefault
marginfloat—
SetShapevoid
# SetShape
C#
public void SetShape(Shape3D shape);
Parameters
NameTypeDefault
shapeShape3D—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.