Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating a ring of rectangles, then create series of rings to create a cylinder
Hi guys,

here is what I'm trying to achieve: 
1. Create a ring of rectangles according to a circular spline
2. Create a bunch of these rings next to each other to create a cylinder of rectangles of rings 

I have achieve the effect of this but however I cannot build the project on VR with oculus. 

Before I build, console already outputs errors:

NullReferenceException: Object reference not set to an instance of an object

FluffyUnderware.Curvy.Generator.Modules.CreateGameObject.OnDestroy () (at Assets/Plugins/Curvy/Base/CG Modules/CreateGameObject.cs:104)
UnityEngine.ObjectBig GrinestroyImmediate(Object)
FluffyUnderware.DevTools.PrefabPoolTongueush(GameObject) (at Assets/Plugins/DevTools/Components/PrefabPool.cs:227)
FluffyUnderware.Curvy.Generator.CGGameObjectResourceLoaderBig Grinestroy(CGModule, Component, String, Boolean) (at Assets/Plugins/Curvy/Base/CG/CGResource.cs:255)
FluffyUnderware.Curvy.Generator.CGResourceHandlerBig GrinestroyResource(CGModule, String, Component, String, Boolean) (at Assets/Plugins/Curvy/Base/CG/CGResource.cs:71)
FluffyUnderware.Curvy.Generator.CGModuleBig GrineleteManagedResource(String, Component, String, Boolean) (at Assets/Plugins/Curvy/Base/CG/CGModule.cs:609)
FluffyUnderware.Curvy.Generator.Modules.CreateGameObject:Clear() (at Assets/Plugins/Curvy/Base/CG Modules/CreateGameObject.cs:122)
FluffyUnderware.Curvy.Generator.Modules.CreateGameObject:Refresh() (at Assets/Plugins/Curvy/Base/CG Modules/CreateGameObject.cs:142)
FluffyUnderware.Curvy.Generator.CGModule:doRefresh() (at Assets/Plugins/Curvy/Base/CG/CGModule.cs:825)
FluffyUnderware.Curvy.Generator.CurvyGenerator:Refresh(Boolean) (at Assets/Plugins/Curvy/Base/CG/CurvyGenerator.cs:595)

and when I build, I get another reoccurring error message:

ID of 'Create GameObject_7_GameObject7_GO ring001' isn't unique!

FluffyUnderware.Curvy.Generator.CurvyGenerator:Initialize(Boolean) (at Assets/Plugins/Curvy/Base/CG/CurvyGenerator.cs:530)
FluffyUnderware.Curvy.Generator.CurvyGenerator:Update() (at Assets/Plugins/Curvy/Base/CG/CurvyGenerator.cs:243) 

For some context, the first ring of rectangles I got from step 1 I created a prefab of and fed into step 2 generator. The name of the prefab is called GO ring,

I haven't looked deep it this yet, but from a first look, I think that the issue comes from GO ring having a generator in it. Try modify your setup having only the meshes in GO ring, and not the generator. The "Save To Scene" button in the Create mesh module might help you exporting the created meshes outside of the curvy generator.
Is my explanation clear?
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Here is the code modification to avoid your issue. Go to CurvyGenerator.cs, and in the Initialize method, replace the first for loop with this one:
for (int i = 0; i < Modules.Count; i++)
                   CGModule cgModule = Modules[i];

                   if (!cgModule.IsInitialized || force)

                   //This happens for example if a generator creates GameObjects that are generators themselves
                   if (cgModule.Generator != this)

                   if (ModulesByID.ContainsKey(cgModule.UniqueID))
                       Debug.LogError("ID of '" + cgModule.ModuleName + "' isn't unique!");
                   ModulesByID.Add(cgModule.UniqueID, cgModule);

I still recommand you to use GO ring as a way to make the ring, and put the ring itself, stripped from the generator, as an input to the second generator. This way you will use less CPU and memory.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.

Possibly Related Threads…
Thread Author Replies Views Last Post
Heart Create beautiful curves ShiroeYamamoto 3 11 03-26-2024, 06:25 PM
Last Post: _Aka_
  Is it possible to create a road texture at runtime? artsung 1 4 01-30-2024, 09:30 AM
Last Post: _Aka_
  Combine 2 Create Mesh nodes to one single Mesh danne_lindwall 1 13 02-16-2023, 08:25 PM
Last Post: _Aka_
  How to create gaps in spline mesh? linkinballzpokemon 1 6 04-09-2022, 12:29 PM
Last Post: _Aka_

Forum Jump: