Skip to content

Commit

Permalink
Fixed Placement Bug
Browse files Browse the repository at this point in the history
Fixed floating stones
  • Loading branch information
killzoms committed Dec 24, 2024
1 parent 9c50876 commit 774a28d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ public IEnumerator SpawnAsync(WorldEntity entity, Optional<GameObject> parent, E
}
}

if (prefabPlaceholderGroup.OnPrefabGroupSpawned != null) // Handles setting isKinematic on Floating Stones
{
prefabPlaceholderGroup.OnPrefabGroupSpawned();
}

result.Set(prefabPlaceholderGroupGameObject);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ private bool VerifyCanSpawnOrError(WorldEntity entity, Optional<GameObject> pare
return true;
}

Log.Error($"[{nameof(PrefabPlaceholderEntitySpawner)}] Can't find a {nameof(PrefabPlaceholdersGroup)} on parent for {entity.Id}");
Log.Error($"[{nameof(PrefabPlaceholderEntitySpawner)}] Can't find a {nameof(PrefabPlaceholdersGroup)} on parent: {parent}\n for: {entity}");
placeholder = null;
return false;
}

private void SetupObject(WorldEntity entity, GameObject gameObject, GameObject parent)
{
if (entity is PrefabPlaceholderEntity prefabEntity && !prefabEntity.IsEntitySlotEntity && parent)
if (parent)
{
gameObject.transform.localPosition = entity.Transform.LocalPosition.ToUnity();
gameObject.transform.localRotation = entity.Transform.LocalRotation.ToUnity();
Expand Down

0 comments on commit 774a28d

Please sign in to comment.