0
Fixed

Missing constructors for GameObject

Joshua Galvin 2 years ago updated by Lazlo Bonin (Lead Developer) 2 years ago 7

I've tried searching for it and found nothing. Whats the equiv of new GameObject("foo");

I've created Vector3s and other classes but I can't seem to find anything that would do the above.

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
GOOD, I'M SATISFIED
Satisfaction mark by Joshua Galvin 2 years ago
Answered

D'oh! That's my bad. Simple mistake.

I disabled all constructors for types derived from UnityEngine.Object because usually they're illegal (you can't construct a component or a scriptable object, for example). I forgot that it's actually legal to construct a Game Object, though. I'll add these back for v.1.0.2: http://support.ludiq.io/topics/255-version-102/

In the mean time, if you absolutely need to instantiate a blank object, you could always create a prefab with no component and use GameObject.Instantiate on it. It's not ideal but it should do the trick!

+1

That was my exact work around

+1

I've been doing https://unity3d.com/learn/tutorials/projects/2d-roguelike-tutorial using Bolt instead of C#, btw. I'll share the resulting graphs but that's where most of these issues are popping up.

Great idea! Would love to see the end result. :)