Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Assets Obi Particle Based Physics (Cloth, Rope, Fluid) thread

Discussion in 'Works In Progress' started by arkano22, Jun 30, 2015.

?

Performance vs compatibility

Poll closed Oct 9, 2015.
  1. I don't care about performance, keep my data intact please.

    0 vote(s)
    0.0%
  2. I don't care if I have to re-do some stuff, as long as it runs faster.

    14 vote(s)
    100.0%
  1. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,045
    Does it work with unity wind system?
     
  2. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
  3. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    440
    Obi Ropes in action:

     
    hopeful likes this.
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    5,570
    Or we could have a muscle simulation to create the blendshape to begin with :thinkaboutit: marvelous designer but for muscle
     
  5. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,816
    That looks nice!
    The water shader is also looking good
     
  6. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    440
  7. nikolay_i

    nikolay_i

    Joined:
    Jan 5, 2020
    Posts:
    7
    Hello. We have silent crash in the project
    Here is a postmortem of the crash, with details about issue in the obicloth package

    1. After adding 2 instances of one prefab with ObiCloth component to the scene unity started crashing when we tried to start the scene in PlayMode. without any standard debug popup with crash details. UnityEditor log files didn't contains any usefull info
    2. I opened Event Viewer and found following Application Error report
    Code (csharp):
    1.  
    2. Faulting application name: Unity.exe, version: 2019.2.21.21133, time stamp: 0x5e38c5b9
    3. Faulting module name: ntdll.dll, version: 10.0.18362.418, time stamp: 0x99ca0526
    4. Exception code: 0xc0000374
    5. Fault offset: 0x00000000000f9269
    6. Faulting process id: 0x6b68
    7. Faulting application start time: 0x01d62d2078750ad6
    8. Faulting application path: C:\Program Files\Unity2018\2019.2.21f1\Editor\Unity.exe
    9. Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll
    10. Report Id: a875fdea-0fcf-41e5-912f-1cc022204ef2
    11. Faulting package full name:
    12. Faulting package-relative application ID:
    13.  
    And error 0xc0000374 indicate that it's a heap problem. But the crashes appeared on several machines in our office. so that wasn't because of the failed RAM modules.
    3. I started follow Windows Debugging manual
    3. At the end of the manual there is an instruction how to generate dump files for any crashes in windows. So I added following keys as adviced to the registry
    • Open the registry.
    • Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting
    • Create LocalDumps folder if it’s not there.
    • Add following keys:
      • “DumpFolder”=<FolderPath goes here> , for example, C:\Temp
      • “DumpCount”=dword:00000010
      • “DumpType”=dword:00000002
    4.After that. dump files started to be stored in to the temp folder. So I opened MSDebugger and added the symbols pdb location.
    5. After the crashes unity started to show poup with details and small dump files about just errors. Here is an output of the error
    Code (csharp):
    1.  
    2. ========== OUTPUTTING STACK TRACE ==================
    3.  
    4. 0x00007FFBECC1ACEF (ntdll) RtlSizeHeap
    5. 0x00007FFB49726806 (AcLayers) NotifyShims
    6. 0x00007FFB398158F4 (mono-2.0-bdwgc) [d:\th\minkernel\crts\ucrt\src\appcrt\heap\free_base.cpp:107] _free_base
    7. 0x00007FFB3955A18E (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\mono-debug.c:512] mono_debug_add_method
    8. 0x00007FFB396811A8 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\debug-mini.c:282] mono_debug_close_method
    9. 0x00007FFB395D5429 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini.c:2414] mono_codegen
    10. 0x00007FFB395D3258 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini.c:3858] mini_method_compile
    11. 0x00007FFB395D7041 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini.c:4197] mono_jit_compile_method_inner
    12. 0x00007FFB395DB462 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-runtime.c:2133] mono_jit_compile_method_with_opt
    13. 0x00007FFB396B5C26 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:716] common_call_trampoline
    14. 0x00007FFB396B7C44 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:848] mono_magic_trampoline
    15.   ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 0000026861A103A3)
    16.   ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 0000026861A103A3)
    17. 0x0000026861A103A3 ((<unknown>)) (function-name not available)
    18. 0x000002687B52DFBB (Mono JIT Code) [C:\buildslave\unity\build\Modules\UIElements\UXML\VisualTreeAsset.cs:132] UnityEngine.UIElements.VisualTreeAsset:CloneTree (UnityEngine.UIElements.VisualElement,System.Collections.Generic.Dictionary`2<string, UnityEngine.UIElements.VisualElement>)
    19. 0x000002687B52DDAB (Mono JIT Code) [C:\buildslave\unity\build\Modules\UIElements\UXML\VisualTreeAsset.cs:121] UnityEngine.UIElements.VisualTreeAsset:CloneTree (UnityEngine.UIElements.VisualElement)
    20. 0x000002687B52D9AB (Mono JIT Code) [C:\buildslave\unity\build\Modules\UIElements\UXML\VisualTreeAsset.cs:106] UnityEngine.UIElements.VisualTreeAsset:CloneTree ()
    21. 0x000002687B52D023 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\Inspector\InspectorWindow.cs:238] UnityEditor.InspectorWindow:LoadVisualTreeFromUxml ()
    22. 0x000002687B52C413 (Mono JIT Code) [C:\buildslave\unity\build\Editor\Mono\Inspector\InspectorWindow.cs:199] UnityEditor.InspectorWindow:OnEnable ()
    23. 0x00000268D64EA218 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    24. 0x00007FFB395DBFB0 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-runtime.c:2809] mono_jit_runtime_invoke
    25. 0x00007FFB39562142 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2921] do_runtime_invoke
    26. 0x00007FFB3956B13F (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2968] mono_runtime_invoke
    27. 0x00007FF6EFE51012 (Unity) scripting_method_invoke
    28. 0x00007FF6EFE4ACC1 (Unity) ScriptingInvocation::Invoke
    29. 0x00007FF6EFE4AF3E (Unity) ScriptingInvocation::InvokeChecked
    30. 0x00007FF6EFEA9EB2 (Unity) SerializableManagedRef::CallMethod
    31. 0x00007FF6EFE080AB (Unity) MonoBehaviour::DidReloadDomain
    32. 0x00007FF6EFEA9956 (Unity) SerializableManagedRefsUtilities::AwakeInstancesAfterBackupRestoration
    33. 0x00007FF6EFE08AFF (Unity) MonoManager::EndReloadAssembly
    34. 0x00007FF6EFE13C69 (Unity) MonoManager::ReloadAssembly
    35. 0x00007FF6EE44E103 (Unity) ReloadAllUsedAssemblies
    36. 0x00007FF6EE42BCBF (Unity) EditorSceneManager::RestoreSceneBackups
    37. 0x00007FF6EDEB3F18 (Unity) PlayerLoopController::EnterPlayMode
    38. 0x00007FF6EDEC757D (Unity) PlayerLoopController::SetIsPlaying
    39. 0x00007FF6EDECA4D7 (Unity) Application::TickTimer
    40. 0x00007FF6EE75F0A0 (Unity) MainMessageLoop
    41. 0x00007FF6EE761ABF (Unity) WinMain
    42. 0x00007FF6F141C962 (Unity) __scrt_common_main_seh
    43.   ERROR: SymGetSymFromAddr64, GetLastError: 'Unknown error [-1073741819]' (Address: 00007FFBEB617BD4)
    44. 0x00007FFBEB617BD4 (KERNEL32) (function-name not available)
    45. 0x00007FFBECC4CED1 (ntdll) RtlUserThreadStart
    46.  
    47. ========== END OF STACKTRACE ===========
    48.  
    6. I found it very suspicious that the crash started with UnityEngine.UIElements even that we do not use UIElements in the project
    7. I searched the project source files for the UIElements entries and found ObiSettingsProvider, and then I just commented OnActivateMethod.
    8. After that I started receive following crush dumps
    Code (csharp):
    1.  
    2. ========== OUTPUTTING STACK TRACE ==================
    3.  
    4. 0x00007FFBECC1ACEF (ntdll) RtlSizeHeap
    5. 0x00007FFB25AA6806 (AcLayers) NotifyShims
    6. 0x00007FFB206158F4 (mono-2.0-bdwgc) [d:\th\minkernel\crts\ucrt\src\appcrt\heap\free_base.cpp:107] _free_base
    7. 0x00007FFB203D5241 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini.c:2329] mono_codegen
    8. 0x00007FFB203D3258 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini.c:3858] mini_method_compile
    9. 0x00007FFB203D7041 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini.c:4197] mono_jit_compile_method_inner
    10. 0x00007FFB203DB462 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-runtime.c:2133] mono_jit_compile_method_with_opt
    11. 0x00007FFB204B5C26 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:716] common_call_trampoline
    12. 0x00007FFB204B7C44 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-trampolines.c:848] mono_magic_trampoline
    13.   ERROR: SymGetSymFromAddr64, GetLastError: 'The specified module could not be found.' (Address: 00000214249803A3)
    14.   ERROR: SymGetModuleInfo64, GetLastError: 'A dynamic link library (DLL) initialization routine failed.' (Address: 00000214249803A3)
    15. 0x00000214249803A3 ((<unknown>)) (function-name not available)
    16. 0x000002144A3930E3 (Mono JIT Code) [C:\Users\NikolayKandalintsev\workspace\TKSingen\Assets\Plugins\Obi\Scripts\Utils\ObiParticleAttachment.cs:339] Obi.ObiParticleAttachment:Disable (Obi.ObiParticleAttachment/AttachmentType)
    17. 0x000002144A392983 (Mono JIT Code) [C:\Users\NikolayKandalintsev\workspace\TKSingen\Assets\Plugins\Obi\Scripts\Utils\ObiParticleAttachment.cs:167] Obi.ObiParticleAttachment:OnValidate ()
    18. 0x00000214D81F8888 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void__this__ (object,intptr,intptr,intptr)
    19. 0x00007FFB203DBFB0 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\mini\mini-runtime.c:2809] mono_jit_runtime_invoke
    20. 0x00007FFB20362142 (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2921] do_runtime_invoke
    21. 0x00007FFB2036B13F (mono-2.0-bdwgc) [c:\build\output\unity-technologies\mono\mono\metadata\object.c:2968] mono_runtime_invoke
    22. 0x00007FF6EFE51012 (Unity) scripting_method_invoke
    23. 0x00007FF6EFE4ACC1 (Unity) ScriptingInvocation::Invoke
    24. 0x00007FF6EFE4AF3E (Unity) ScriptingInvocation::InvokeChecked
    25. 0x00007FF6EFEA9EB2 (Unity) SerializableManagedRef::CallMethod
    26. 0x00007FF6EFE04643 (Unity) MonoBehaviour::CheckConsistency
    27. 0x00007FF6EFE023E4 (Unity) MonoBehaviour::AwakeAfterRestoreFromBackup
    28. 0x00007FF6EFEA9956 (Unity) SerializableManagedRefsUtilities::AwakeInstancesAfterBackupRestoration
    29. 0x00007FF6EFE08AFF (Unity) MonoManager::EndReloadAssembly
    30. 0x00007FF6EFE13C69 (Unity) MonoManager::ReloadAssembly
    31. 0x00007FF6EE44E103 (Unity) ReloadAllUsedAssemblies
    32. 0x00007FF6EDEC94FD (Unity) Application::TickTimer
    33. 0x00007FF6EE75F0A0 (Unity) MainMessageLoop
    34. 0x00007FF6EE761ABF (Unity) WinMain
    35. 0x00007FF6F141C962 (Unity) __scrt_common_main_seh
    36. 0x00007FFBEB617BD4 (KERNEL32) BaseThreadInitThunk
    37. 0x00007FFBECC4CED1 (ntdll) RtlUserThreadStart
    38.  
    39. ========== END OF STACKTRACE ===========
    40.  
    9. Here it become obvious that the problem is in the ObiParticleAttachment and Enable function of the ObiParticleAttachement class it didn't work proper with AttachmentType.Static
    10. I checked the ParticleAttachments on the object and changed Static to Dinamic, returned commented code back (step 7) and crashes disapeeared


    Hope that helps.

    p.s. I tried to register on your forum, but didn't receive confirmation email so I post it here.
    Thanks.
    //Nikolay
     
  8. AryaTcs

    AryaTcs

    Joined:
    Jun 21, 2019
    Posts:
    8
    Hi,
    I am new to Unity. Can you please tell me how to make continuous liquid flow where i can control speed of liquid flow and there shouldn't be space between flow of liquid. i can see the gap between the flow of liquid how to get continuous flow when speed is increased. Please support. Thanks in advance.
     
  9. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    Generally we don't offer support here. We have our own support forum (http://obi.virtualmethodstudio.com/forum/index.php) and email. Will answer your question here for convenience, though.

    You can't ensure no spacing in the flow under all circumstances because in Unity (like in all game engines, or rather, all computer programs), time is discrete. Particle spacing is automatically calculated so that density (the amount of particles per volume unit) is constant and no pressure spikes take place. This means some frames, particles are spawned (1,2,3, or more layers of particles), and some other frames, they aren't. You can't spawn a particle in-between frames.

    In offline fluid simulators this is usually circumvented by post-processing the simulation, detecting gaps and seeding additional particles there (sheet/filament preservation) or by sub stepping emission. Neither is doable in realtime.

    Your best bet is to reduce the emission speed. Sometimes reducing the solver gravity also helps, both with this and with compressibility (less gravity = less pressure = less work for the solver).
     
    Last edited: May 27, 2020
  10. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    38
    Is there is way to create ropes without blueprints?
    I am planning use few ropes on every game level, they all will be different so in my case I don’t need use shared blueprint, but must create many blueprints for every rope. I didn’t find option which allow to store(serialize) rope control points in the Rope component itself without blueprint container.
    Is there is a way to do that?
     
  11. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    Why would you even want to do that? regardless of where you serialize the control points, the amount of data is exactly the same. It won't generate less data if you serialize them in the scene (ObiRope component) compared to using a separate asset (the blueprint).

    Serializing in blueprints instead of scenes has the added benefits of not bloating your scene with extra data, and the scene file will not constantly show up as modified in version control systems (git, svn, etc) every time you modify a single rope. This was a major pain point for many users in previous Obi incarnations and one of the main reasons that drove us to design blueprints in the first place: to decouple scene data from actor data.

    If you need to create many blueprints because each individual rope is slightly different, there's nothing wrong with this at all. You can even do that at runtime if needed. Same pattern is used for many other assets in Unity: if you need to have 250 individual materials/textures/models/audio samples in a scene, you can.
     
    Last edited: Jul 31, 2020
  12. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    38
    At the current state, architecture with blueprints are good for big projects. But as you know, most of the unity projects are simple mobile games or even prototypes(where dev time is very important). With blueprints we need more time(if game mechanics is based on ropes) to create and organize blueprints.
    It would be nice to have 2 ways(every dev choose own) to store ropes data:
    - blueprints
    - inside Rope or other game object component
     
  13. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    This exact same mechanic is used with most other Unity assets. If you need 20 materials in your scene, you need to create 20 materials and then assign them to their respective renderers. I don't see how storing all the data in the scene would be of any benefit to anyone, it does not make things easier to use, faster, nor saves any memory/storage space. o_O

    Maybe you can write a small editor script that generates a blueprint automatically every time you add a new rope component, and assigns both. Less than 10 lines of code that would save you from having to manually create and drag the blueprint for each rope, but that's about it. Also a valid solution for any other task of mass-creating components/assets. Let me know if you need help with this.
     
    Last edited: Jul 31, 2020
  14. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    38
    Unity has prefabs, I can create 1 rope prefab, and place it anywhere multiple times, without increase scene size.
    If I want make small changes to the rope, I will create prefab variant and make changes to it.
    I think current implementation with blueprints is unnecessarily, because it can be simply replaced with prefabs workflow.
    Nevertheless I have some idea how to work with this
     
  15. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    Prefabs store all serializable data in an object. Blueprints only store particle/constraint data, since actors also have quite some data of their own that is not necessarily tied to the blueprint. The amount of data stored in a blueprint can get really large (specially for long ropes), so it makes sense to separate it from the rope itself, instead of forcing users to make a prefab out of every rope in their scenes to keep sane scene file sizes. This a well known hot/cold data splitting pattern used a lot in architectural design.
     
    IsDon likes this.
  16. vizgl

    vizgl

    Joined:
    Nov 4, 2014
    Posts:
    38
    I found bug.(?)
    Let's make 2 ropes with the same blueprint(also reproduced with two different blueprints) and enabled self collisions.
    Also add ObiParticleDragger to the scene, to allow drag ropes.
    Ropes collide with each other, except particles with the same indices.

    For example, ropes has same length and same particles count 5(ropes on the screenshots has around 20 particles, so problem is not in the gaps)
    Every particle on every rope is enumerated 0,1,2,3,4.
    Collision are worked between particles with different indices, but when I try collide points 0-0, 1-1... they doesn't collide.
    No collision(same index, 0-0):
    upload_2020-8-5_12-39-48.png

    Has collision(different indices 2-1)
    upload_2020-8-5_12-42-25.png
     
  17. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    Hi,

    This is by design, as explained in the manual:
    http://obi.virtualmethodstudio.com/tutorials/collisions.html

    Only particles in different phases are guaranteed to collide with each other.

    Since you enabled self-collisions for both ropes, but both have the same phase (the default one), they will collide with each other applying rest pruning: particles in indices that overlap will ignore collisions with each other. Indices 0 and 0 obviously overlap, so they will ignore each other. This is important to prevent constraint fighting, which causes jittering because collisions separate particles apart but distance constraints pull them back together.

    Solution: give a separate phase value to each of your ropes. This can be done on a per-control point basis using the path editor, or done at runtime for entire ropes using rope.SetPhase(). Keep in mind that there's only 32 different phases available.

    Note: Also, please refrain from posting in the Unity forums asking for support. I seldom check the Unity forums (couple times a week at most), official Obi support forums/email exist for a reason.;)
     
    Last edited: Aug 5, 2020
  18. mitesh123

    mitesh123

    Joined:
    Nov 8, 2018
    Posts:
    1
    Hello,I am using obi Fluid. i am developing product for augmented reality using ARFoundation for android. i seen your tutorial and buying asset from assets store.when i build apk its hangs and runnig very slow and also particles not appearing.can you suggest me settings how i can use obi fluid in arfoundation. I am making chemical Mixing Scene.And AR session also have camera and your scene have main camera with profiler & renderer. i added on arcamera but it cant works.Please help me....
     
  19. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    Hi,

    Fluid rendering uses screen-space ellipsoid splatting, which is akin to deferred rendering. Most mobile devices are extremely fill-rate limited, so you will need to use downsampling for fast rendering. See:
    http://obi.virtualmethodstudio.com/tutorials/fluidrendering.html

    Depending on how ARFoundation works and how it blends the scene with the camera feed, you might need to modify the fluid shaders to work in conjunction with AR.

    Also note that we don't offer support trough the Unity forums. We have our own support channels (Obi forums and support email), so please use them if possible.
     
    mitesh123 likes this.
  20. Jakub_Machowski

    Jakub_Machowski

    Joined:
    Mar 19, 2013
    Posts:
    409
    @arkano22 I bought obi Rope some time ago, We just waited to improve it to our game the problem is that We are on 2018.4 and I saw your product is no more downloadable for that version. Why is like that? Is there any version that work on 2018.4 or if not could we ask for refund? Best Regards
     
  21. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    Hi Jakub,

    I answered your support email, check your inbox ;). cheers!
     
  22. DevATsci

    DevATsci

    Joined:
    Jul 23, 2020
    Posts:
    43
    Hi @arkano22 were using ObiRopes. At compile time the build crashes with this error

    Code (CSharp):
    1. Shader error in 'Obi/Particles': invalid subscript '_ShadowCoord' at line 92 (on xboxone)
    2.  
    3. Compiling Vertex program with DIRECTIONAL SHADOWS_SHADOWMASK LIGHTPROBE_SH
    4. Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_FULL_HDR
    5.  
    This line of code is highlighted in the Particleshader.shader script

    Code (CSharp):
    1.                 UNITY_LIGHT_ATTENUATION(atten,i,0);
    Were using D3D12 on an Xbox1x to compile (this error also happens on D3D11). Can you help with the workaround please?
     
  23. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    I'm assuming you're using an older version of Obi, since line 92 in the shader no longer does attenuation. There should be a "nolightmap" definition in the #pragma at line 21:

    Code (CSharp):
    1.  #pragma multi_compile_fwdbase nolightmap
    If it's already there, then the problem might be something else. Depending on what kind of rendering options you're using, unity might not be defining _ShadowCoord internally, which is used for shadow mapping. It's unclear to me in what cases this might not be defined, though.

    Simplest workaround is to just replace:
    Code (CSharp):
    1.                 UNITY_LIGHT_ATTENUATION(atten,i,0);
    with
    Code (CSharp):
    1.                float atten = 1;
    This will remove shadow support from the particle shader, but it's highly unlikely you're using it for a release build (as it's mostly used for debugging/visualization in editor).
     
    DevATsci likes this.
  24. DevATsci

    DevATsci

    Joined:
    Jul 23, 2020
    Posts:
    43
    Hi @arkano22

    Thanks for the perfect response. Always nice to meet a Pro. I got the build working by selecting "Build this platform" in the inspector on the particleshader.shader script which is where the above lines of code come from. However your bug fix i also inputted and it worked on both accounts. Always good to have 2 fixes instead of one.

    Thank you for your assistance.
     
    Last edited: Oct 26, 2020
  25. xpxilom

    xpxilom

    Joined:
    Aug 28, 2014
    Posts:
    21
    I am creating a game. It's about untangling rope

    Almost everything is ready.

    But I don't know how to save the string positions.
    that is, the knots already made.

    When I play unity, I can create the knots, but how can I save the positions of the knots?
     
  26. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    752
    To get/set particle properties such as positions/velocities, you can use the particle API. See:
    http://obi.virtualmethodstudio.com/tutorials/scriptingparticles.html
     
unityunity