#How to spawn/create a capybara toy?
1 messages · Page 1 of 1 (latest)
you need to get the prefab
and UnityEngine.Object.Instantiate(prefab);
and then you have it
CapybaraToy? toy = null;
foreach (GameObject prefab in NetworkClient.prefabs.Values)
{
if (prefab.TryGetComponent(out toy))
break;
}
if (toy != null)
CapybaraToy instance = UnityEngine.Object.Instantiate(toy);
In the future there will be CapybaraToy.Create
Like when 14.1 is fully public?
should be sooner
make a pr
i aint doing allat if its already in their internal repo
oh i didnt know its in their internal repo
So all the capybaras wonderful properties are in "toy"?
no it will be in instance
the toy property there is the found prefab
which you use to create your actual toy
consider the prefab the blueprint on how to make the toy
Then how to build the capybara with the blueprints now?
this
the instance is the created one
Now I get it thank you!
You can just put the spawning logic in the loop and break instead of doing a null check (-10 nanoseconds
)
ruh roh
The nanosends are important!
If you do this operation then every frame then yes
[ERROR] [LabApi] Failed to create derived admin toy wrapper. Missing constructor handler for type AdminToys.CapybaraToy
Yeah you have to go with the base game solution for now
So it's not possible to create a capybara?
You can
With this
Yeah I used that and got this
you can ignore that, it should still work fine
also capybara wrappers are being made internally
I haven't gotten a capybara to spawn and with the release of labapi 0.7.0 is there new methods?
there should be CapybaraToy.Create(...)
Nope, should be the wrapper type in LabAPI.Features.Wrappers.CapybaraToy
I see, I see
Can I just fill the brackets with ev.Player.Position, ev.Player.Rotation
try it and see
