CUA Editor tutorial

Guides CUA Editor tutorial

hazmhox

Moderator
Featured Contributor
Messages
1,516
Reactions
7,331
Points
173
hazmhox submitted a new resource:

CUA Editor tutorial - A quick tutorial to show and explain a base editor for your Custom Unity Assets

A few person on discord and on the hub asked if it was possible to control a custom asset through script... so after fixing a bug I had with mine with the help of meshed, I promised I made a tutorial to share the knowledge. So here we go.


What do you need?

  • C# knowledge
  • A bit of Unity knowledge
  • A bit of "VAM code" knowledge (included in VAM as a VS solution)


What is the goal of the tutorial?

It is meant to show you how to create a...

Read more about this resource...
 
No problem ! meshed help me, the least I can do is give a bit of knowledge to the community :)
 
Is there an Atom Creator method similar to the Clothing Creator? After I've created a CUA, is there a way to save it to the default Atom list so as to not have to browse my assetbundle, select the asset, add the plugin file over and over.
 
Is there an Atom Creator method similar to the Clothing Creator? After I've created a CUA, is there a way to save it to the default Atom list so as to not have to browse my assetbundle, select the asset, add the plugin file over and over.

Nope ! We discussed about that with meshed a while ago on discord... this is something that will happen in 2.x.

If this is only a matter of ease to use, you could create a subscene with the thing you need in it ( your asset + script ) and load it in your scene. It is the only way I can think of at the moment.
 
I am trying to make a script to make a serial connection between Arduino and VAM and make the Arduino do something simple at first like rotate and move a cube. When the Arduino for example sends the string "rotate cube left" or "rotate cube right" or "move cube left" or "move cube right" Through COM1 That this will happen in the VAM world.I am very good with Arduino but I am still learning VAM coding" Any help is appreciated I need something very basic to get me started and then I can make it more and more advanced. I want to add to VAM the power of micro controllers like Arduino or Raspberry PI and allow VAM to interact with sensors and smart devices and eventually artificial intelligence.
 
I am trying to make a script to make a serial connection between Arduino and VAM and make the Arduino do [...]

Hey hellhound :)
I have absolutely no clue about electronics and their connection to something like VaM. That said, what you need is understanding GameObjects / Prefabs if you want to manipulate them inside Unity.

This is an extract of the tutorial and this is the important part. If you know advanced coding to work with Arduinos, I think you can find the source of how I get the renderer or the transform ;)

C#:
                // This is interacting with a renderer
                cubeRenderer.material.SetColor("_Color",newColor);

                // This is interacting with a gameobject
                cubeTR.gameObject.SetActive(visibility);

You can find more informations about transforms here : https://docs.unity3d.com/ScriptReference/Transform.html
This is also the place where you can find every other base components of Unity.

The documentation of Unity is really cool, and I think you will understand the basic features pretty quickly. I can't say the same thing for the communication with the Arduino tho. I can't help you with that... I have absolutely no clue how you would communicate with it.

That said... you can look at another "re-bundle" I made of a script someone made to communicate with tele-dildos. This is not the same "direction", since it is sending commands to the tele-dildos and not receiving, but I think it might be helpful... :)
 
Hey hellhound :)
I have absolutely no clue about electronics and their connection to something like VaM. That said, what you need is understanding GameObjects / Prefabs if you want to manipulate them inside Unity.

This is an extract of the tutorial and this is the important part. If you know advanced coding to work with Arduinos, I think you can find the source of how I get the renderer or the transform ;)

C#:
                // This is interacting with a renderer
                cubeRenderer.material.SetColor("_Color",newColor);

                // This is interacting with a gameobject
                cubeTR.gameObject.SetActive(visibility);

You can find more informations about transforms here : https://docs.unity3d.com/ScriptReference/Transform.html
This is also the place where you can find every other base components of Unity.

The documentation of Unity is really cool, and I think you will understand the basic features pretty quickly. I can't say the same thing for the communication with the Arduino tho. I can't help you with that... I have absolutely no clue how you would communicate with it.

That said... you can look at another "re-bundle" I made of a script someone made to communicate with tele-dildos. This is not the same "direction", since it is sending commands to the tele-dildos and not receiving, but I think it might be helpful... :)
Hello Hazmhox :)
Thank you for your reply and for the information.
I saw the tele-dildos plugin but it has way too much code haha and does indeed only transfer one direction commands.
What I need to start to know is how to address the cube that is build in VAM how the object is called and which command it uses to transform.
I think it would be great if there is like tutorials out there or documentation with examples for people to understand how VAM coding works and how to retrieve the names of objects in VAM and translate that to code. It would bring more script content creators when it is easier to learn.
 
"VaM" is Unity. If you understand how to control a Transform or a GameObject, you kinda more or less know how to control an object in VaM :]

That said you're right, VaM as some specificities, so the best would be for you to start your implementation with Unity ( if it's for VaM 1.x, then 2018 1.9f2 ), then from there, if your code start to work and you understand a bit c# scripting, you can rely on this tutorial to "translate" your code with a Custom Unity Asset for VaM :)
 
I will start making a free guide with resources and information to learn unity and C# programming for beginners and update it this should help more people to better understand how to start making scripts for VAM.
 
hey i am working thru this tutorial, really interesting. Is there a way to animate a CUA? like change the size of a toy with a trigger? thanks!
 
hey i am working thru this tutorial, really interesting. Is there a way to animate a CUA? like change the size of a toy with a trigger? thanks!

Hey!

- You can animate CUAs using the legacy animation system from Unity. Stasis Lab with the demo included in HZMDemos shows an example of that with the cryopod.
- I have never tried to animate the scale of an atom at runtime, but, I suppose the scale in the physics settings might be accessible with triggers if it's a native atom. Or if not, it is completely possible with a script like in this tutorial.
 
Back
Top Bottom