05-09-2023, 08:38 PM
Like in this video, is there a way to deform a gameobject similar to deform mesh? Trying to curve the mesh.
https://youtu.be/eP6QEn9SFoM
https://youtu.be/eP6QEn9SFoM
Is there a way to deform a gameobject?
|
05-09-2023, 08:38 PM
Like in this video, is there a way to deform a gameobject similar to deform mesh? Trying to curve the mesh.
https://youtu.be/eP6QEn9SFoM
05-10-2023, 09:27 AM
Yes, using the GameObject To Mesh module. This is showcased in the example scene 29bis_CGDeformMesh_Railway
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Is there a way to still keep the original objects scripts similar to Create Gameobject?
Cause if I'm not mistaken, GameObject to Mesh -> Mesh Create does carry over script functions. Edit* This is to accomplish two things 1) have spawned object wall pieces bend and conform the the spline, while still having functionality. 2) have a spawned segment collider that extrudes/stretches along the spline which can also have scripts. This is so I can have self intersecting checks.
05-11-2023, 10:27 AM
(05-10-2023, 12:42 PM)Lupos Wrote: Is there a way to still keep the original objects scripts similar to Create Gameobject?You would need to make a script, called after the OnRefresh events, that takes the input game objects, and copy whatever data to the output game objects. PS: I told you earlier that I was busy because of something, now I can talk about it: it is the spring sale on the asset store.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
05-11-2023, 12:50 PM
(05-11-2023, 10:27 AM)_Aka_ Wrote: You would need to make a script, called after the OnRefresh events, that takes the input game objects, and copy whatever data to the output game objects. How would this be done? 1) The easiest but slowest way would just to copy the original object component data and pass it into the output somehow. Via Get/Add Component. 2) Maybe having two outputs sorta. 1. is the game objects with their scripts, 2. is the curved mesh. I'd loop through the CGMeshResource, grab its mesh/bounds data, and pass that into my new game objects. (Is this what you meant?) 3) A faster performant way would be to somehow allow pooling of the new objects natively with the renderer. (05-11-2023, 10:27 AM)_Aka_ Wrote: PS: I told you earlier that I was busy because of something, now I can talk about it: it is the spring sale on the asset store. Oooh! I see now. Awesome! I actually was able to solve my closed problem, as well as modify the script to position things better. My issue now is not having curved objects with their original script data anymore.
05-15-2023, 12:15 PM
I was thinking about solution 1. The need to search for a more complex/optimized solution should only raise if the profiler shows so.
If this solution is proven to be problematically slow, then maybe a solution based on separating the input meshes gameobjects from the other scripts, and make the generator work only on the meshes game objects, and then assign the deformed mesh to the gamobject with the other scripts. Not positively sure it is a good solution, just a thought.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
|
« Next Oldest | Next Newest »
|
Possibly Related Threads… | |||||
Thread | Author | Replies | Views | Last Post | |
Mesh deform - baby guide | jmh1804 | 7 | 8 |
08-22-2024, 07:18 AM Last Post: _Aka_ |
|
How to modify Input GameObject's transformation properties by script. | j95677 | 2 | 6 |
07-05-2024, 06:28 PM Last Post: j95677 |
|
Using Prefabs with transformations reset to original state when using Deform mesh | danne_lindwall | 3 | 7 |
04-28-2023, 01:35 PM Last Post: _Aka_ |
|
Way to make gameobject follow splines 'human-ly'? | yun844 | 3 | 12 |
01-17-2023, 10:18 AM Last Post: _Aka_ |