Page MenuHomeFeedback Tracker

Sit on Benches
New, NormalPublic

Description

Yes, it is possible to create a script in Arma Reforger that allows players to sit on benches, but it requires some scripting using Enfusion Script (similar to C++) and a bit of animation setup in the Workbench.

Here's a basic overview of how to do it:


✅ What You Need:

  1. Workbench Access (modding tools).
  1. A bench object in the world (or your custom model).
  1. A sitting animation (e.g., from existing civilian or idle animations).
  1. A trigger or interaction system to let the player sit.

🔧 Steps to Script Sitting on a Bench

  1. Create a Script Component

You’ll need to attach a script to the bench object to detect when a player interacts.

modded class BenchSittingComponentClass : ScriptComponent
{
}

class BenchSittingComponent : ScriptComponent
{
// Called when player interacts
void SitDown(IEntity player)
{

		CharacterControllerComponent controller = CharacterControllerComponent.Cast(player.FindComponent(CharacterControllerComponent));
		if (controller)
		{
			controller.RequestStance(ECharacterStance.IDLE);
			controller.RequestEmote("STANDTO_SIT"); // Replace with actual sitting animation if available
		}

		// Optional: Lock position to the bench
		vector benchPosition = GetOwner().GetOrigin();
		player.SetOrigin(benchPosition + "0 0.5 0"); // Adjust to match the sitting spot

}
}

Replace "STANDTO_SIT" with a valid emote or animation name from Reforger's animation list.


  1. Add Interaction Option

Use the interaction system to let players interact with the bench.

modded class BenchInteraction : SCR_EditableEntityComponent
{
override void OnInteraction(IEntity user, BaseInteractionContext context)
{

		BenchSittingComponent bench = BenchSittingComponent.Cast(GetOwner().FindComponent(BenchSittingComponent));
		if (bench)
		{
			bench.SitDown(user);
		}

}

override void GetInteractionName(out string outName)
{

		outName = "Sit on Bench";

}
}


  1. Attach to Bench in Workbench

In the Workbench:

Add your bench prefab to the world.

Attach the BenchSittingComponent and BenchInteraction scripts to the entity.


🧪 Testing Tips:

Use debug mode to ensure interaction triggers work.

If the animation doesn't look natural, you might need a custom animation or better alignment offsets.

Details

Severity
None
Resolution
Open
Reproducibility
N/A
Operating System
Windows 11 x64
Category
General

Event Timeline