"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

HowToTurnOffMeshTemporarily

I need to reduce the number of draw calls in my Unity project when playing under iOS. Unity 3.4 QCAR 1.5 xCode 4.2 I have tried a multitude of approaches to turn off the mesh renderer, deactivate the game object etc. These methods can successfully turn off the game object and/or its components. However they will not turn back on again. Or they work in the Unity editor but fail under iOS. I also find a distinct difference in behaviour in the Unity editor and when running under iOS using these methods. Is there a specific method for turning off and on the mesh renderer component that will reliably work on iOS? Or activate/deactivate game objects that are within the tracker hierarchy?

DavidBeard

Sat, 03/24/2012 - 14:35

You should be able to use the standard approach of enabling and disabling the Renderer. Can you post some code that you're using to control rendering on these objects? Also if you have a Pro license, you can use occlusion culling.

10polarbears

Sun, 03/25/2012 - 01:04

In this situation it is better to turn off the renderer rather than use culling. I am using Playmaker (Hutong Games) to run the code which will make sending the code a bit difficult. It sounds like I will need to write a handler and call that from Playmaker. I will give that a go. What I find com

10polarbears

Sun, 03/25/2012 - 01:26

Here is some sample code that doesn't work. I attached it to a game object with a render component and it remains visible on play in the editor. The game object is in a target hierarchy.

10polarbears

Sun, 03/25/2012 - 02:34

It looks like I have fixed the issue. I can use Playmaker to Activate Game Object to deactivate the game object recursively thereby turning the entire hierarchy off On Awake. Then use Activate Game Object to reactivate most of the hierarchy recursively combined with an Enable Property (Mesh Rendere

10polarbears

Mon, 03/26/2012 - 02:36

Thank you for posting that code snippet. I will use that to turn on and off the raycast layer. As well as the renderers.

10polarbears

Mon, 03/26/2012 - 03:22

I have added the raycast layer change to the DefaultTrackableEventHandler as quoted below. It doesn't solve my other problem which is that even though I can't see the object being tracked to the target. I can click on the image being tracked and the raycast still triggers.

Brandy281

Fri, 01/11/2019 - 09:55

Is it possible to disable the mirror modifier temporarily, so that I can model my creature with different spikes locations without being mirrored, and then enable it again? It would save me lot of time modelling the rest of his body that will be mirrored