Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Generating multiple object on changing transform
I was working in Unity 2018.2.20 and everything was going good. But then I converted my project in Unity 2018.4.0 because there were some animation issues in previous version of Unity. Now I am facing a strange issue when I change the transform of objects in any Generator, the Generator used to move all the objects' position but now it isn't. Instead it is creating new objects on my new provided position and keeping the previous objects still at old location. I have made prefabs of my tracks. Whenever I instantiate my prefabs or open them to modify them, Generators generate new multiple instances of all the game objects.
I am attaching a Screenshot for better understanding. Looking forward to hear from you soon.
Please try the following, and if it doesn't work please send me a minimal copy of your project
  1. Make sure that all the meshes of your tracks are removed from your scene, then refresh the generator to create them again.
  2. Make sure that your Input Spline Path use the desired value for their Use Global Space option
  3. Make sure that the prefabs you instantiate have the correct parent in your scene hierarchy (the same than the object you made your prefab from)
Hope this helps
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Thanks for your response. I tried all these possible solutions but these are not working for me. Let me send you a copy of my track.
I will exclude the curvy package from it to make it of minimum size.
Your issue is caused by a restriction from the new Prefabs system, introduce in Unity 2018.3. If you look at the console, you will find the following two messages:
  • A message from Unity:
    InvalidOperationException: Destroying a GameObject inside a Prefab instance is not allowed
  • And a message from Curvy that gives more details:
    [Curvy] Error while trying to destroy the object 'Create GameObject_40_GameObject40_Pole000'. This is probably because that object is part of a prefab instance, and Unity 2018.3 and beyond forbid deleting such objects without breaking the prefab link. Please remove the corresponding object from the prefab and try the faulty operation again.
So, this happens because in your prefab you included objects generated by the Curvy Generator. When generating the new objects, Curvy tries to destroy the old ones, but Unity does not allow it to.
So the solution is to not include the generated objects in your prefab, which is the right thing to do anyway, to avoid having huge prefabs. Removing the generated objects from the prefab will make your prefab way lighter, from 18Mo to 0.3Mo.

I will send you via mail the cleaned prefab.

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.
First of all, Thank you so much for your response.
Secondly, Yeah, the new Unity Prefab system, I wasn't aware of it much. The issue is I wasn't getting any message on my console while I was working (not sure if I had turned off messages or warnings at that time).
Actually I didn't know Curvy regenerates new objects and destroys the previous ones, I used to think it just changes the transforms of the generated objects, that's why I never thought of removing the generated objects from my prefabs.
You just made my life so easy. I was sick of these heavy prefabs. You solved my both problems.
Thanks again.
You too have a great day and I am having one.
Glad to read that Smile
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
  Orient Spline to Object DanMarionette 1 109 06-11-2019, 05:56 PM
Last Post: _Aka_
  One generator for multiple paths justinms66 10 2,088 05-30-2019, 03:48 AM
Last Post: Horibe
  Spawning object with correct rotation at spline end arrnav96 2 205 05-21-2019, 02:19 PM
Last Post: arrnav96
Information [Quick and dirty] Shape Extrusion: interpolate between multiple Crosses _Aka_ 7 1,995 04-28-2019, 11:02 PM
Last Post: ChivalrousGames

Forum Jump: