Game/ActionGraphNodes.cs
namespace Opium;
public partial class ActionGraphNodes
{
[ActionGraphNode( "opium.createprop" ), Category( "Opium" ), Title( "Create Prop" ), Icon( "directions_walk" ), Description( "Creates a prop at a location." )]
public static GameObject CreateProp( [Title( "Model" )] Model model, [Title( "Position" )] Vector3 pos, [Title( "Angles" )] Angles angles = default )
{
using var _ = Game.ActiveScene.Push();
var go = new GameObject();
go.Name = "Prop (spawned via ActionGraph)";
go.WorldPosition = pos;
go.WorldRotation = angles.ToRotation();
var prop = go.Components.Create<Prop>();
prop.Model = model;
return go;
}
}