Merfoo Posted February 2, 2014 Share Posted February 2, 2014 So I'm working on a 3d-asteroids game and I'm trying to stop rendering the ship when the game ends by setting the .isVisible property to false. When I set the property to false it stills renders the ship, but when I set the property to true it throws a "Uncaught TypeError: Cannot call method 'isInFrustum' of undefined" error. Link to game with errorhttp://team955.com/3d-asteroids/brokenShip/ Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 2, 2014 Share Posted February 2, 2014 Could you point me out where in your code you'are doing that? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 2, 2014 Share Posted February 2, 2014 I think I got it You are trying to set visible an object without geometry (The parent of the ship (meshes[0]) is a group and you cannot set it visible) Quote Link to comment Share on other sites More sharing options...
Merfoo Posted February 2, 2014 Author Share Posted February 2, 2014 Ah so you can not set the visibility of a mesh with a parent that is a group. Now I just set the mesh._isEnabled property to false and worked , is this the proper way of not rendering meshes if its parent is a group instead? And whats the difference between using the two other than _isEnabled affects children and when would you use one over the other? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 3, 2014 Share Posted February 3, 2014 An invisible object can still participate to collisions where a disabled object is just removed from the scene Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.