#How to spawn/create a capybara toy?

1 messages · Page 1 of 1 (latest)

late bison
#

I've been trying to spawn a capybara toy. I've looked at older posts about admin toys but I can't understand anything (I'm new to making sl plugins and C# coding)

charred shale
#

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

late bison
#

Like when 14.1 is fully public?

charred shale
jaunty thunder
charred shale
jaunty thunder
#

oh i didnt know its in their internal repo

charred shale
#

i dont know if it is

#

but i think someones working on it

#

if not make david do it

late bison
#

So all the capybaras wonderful properties are in "toy"?

jaunty thunder
#

no it will be in instance

charred shale
#

which you use to create your actual toy

#

consider the prefab the blueprint on how to make the toy

late bison
#

Then how to build the capybara with the blueprints now?

charred shale
#

the instance is the created one

late bison
#

Now I get it thank you!

velvet mortar
charred shale
#

ruh roh

late bison
#

The nanosends are important!

velvet mortar
late bison
#

[ERROR] [LabApi] Failed to create derived admin toy wrapper. Missing constructor handler for type AdminToys.CapybaraToy

velvet mortar
#

Yeah you have to go with the base game solution for now

late bison
#

So it's not possible to create a capybara?

velvet mortar
#

You can

late bison
#

Yeah I used that and got this

lunar citrus
#

also capybara wrappers are being made internally

late bison
#

I haven't gotten a capybara to spawn and with the release of labapi 0.7.0 is there new methods?

lunar citrus
#

there should be CapybaraToy.Create(...)

late bison
#

There isnt one?

#

Like at AdminToys.CapybaraToy?

lunar citrus
#

Nope, should be the wrapper type in LabAPI.Features.Wrappers.CapybaraToy

late bison
#

I see, I see

#

Can I just fill the brackets with ev.Player.Position, ev.Player.Rotation

lunar citrus
#

try it and see

late bison
#

Alright

#

It did work

#

How do I then get the capybara to set like collisions?