To fully understand how to use AI prompting in play mode, ask your Sloyd contact (or email hello@sloyd.ai) for the example file "SloydAiExampleIntegration.unitypackage" and look at the scene called "AIPromptExample"
Open Scene AIPromptExample
Inside you can see a very rudimental UI and object ExampleAIPrompt
For Spawning an object we need two things:
SloydAICredentials (we created that in Setup phase)
SloydCachedTemplates (we will talk about this later)
This script is very simple all it does is takes text from Input field and passes it to SloydSDK when button is pressed.
This is done via SloydAIRuntime class (all runtime functionalities are packed in this class, for editor functionalities we have SloydAIEditor)
On Awake we authenticate (you can put this method on your application start).
Then on button click we pass prompt to helper class that returns SloydObject with which you can work
To fully understand how to use AI prompting in play mode, ask your Sloyd contact (hello@sloyd.ai) for an example file: SloydAiExampleIntegration.unitypackage. and look at the scene called "AIEditExample".
Open Scene AIPromptExample
For Spawning an object we need two things:
SloydAICredentials (we created that in Setup phase)
SloydObjectContainer (on object where we will perform edits)
This script is very simple all it does is takes text from Input field and passes it to SloydSDK when button is pressed.
This is done via SloydAIRuntime class (all runtime functionalities are packed in this class, for editor functionalities we have SloydAIEditor)
On Awake we authenticate (you can put this method on your application start).
Then on button click we pass prompt to helper class that changes properties SloydObject. And then we need to rebuild mesh with this new properties
By default AI prompting does not understand color information. For example if you ask for a "Yellow school bus" you'll get the shape of a school bus but the color might be a different default color. If you want the AI to also change colors based on the prompt you need to enable it, here's how:
And you'll get a response like this:
Inside you can see a very rudimental UI and object ExampleAIEdit