Have TASable auto fetch parent if it is null

This commit is contained in:
alex-kumpula 2023-11-11 21:05:57 -07:00
parent 8906d69760
commit eb668bfd63
1 changed files with 6 additions and 0 deletions

View File

@ -2,6 +2,7 @@ using Godot;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
public partial class TASable : Node
{
@ -38,6 +39,11 @@ public partial class TASable : Node
public override void _Ready()
{
if (this._assignedRigidBody3D is null)
{
this._assignedRigidBody3D = this.GetParent<RigidBody3D>();
}
TAS_System TAS = GetNode<TAS_System>("/root/TAS_System");
TAS.FrameIncremented += this.OnFrameIncremented;