Jump to content

Renderable False still renders?


Heppell08
 Share

Recommended Posts

Is my usage of this wrong?

 

I've put it in create, it renders, put it in update, it renders. I have no clue now.

 

Just want the platforms to not render but be updated for colliding. I originally scaled them down to 0.001 so there were "technically" invisible.

 

Heres what i'm doing:

// in createplatforms = game.add.group();	var ground = platforms.create(0, game.world.height - 64, 'ground');	ground.body.immovable = true;	ground.scale.x = game.world.width;        ground.renderable = false;

Also tried platforms.renderable = false; too.

Link to comment
Share on other sites

Try setting visible to false; not sure on the mechanics/uses for renderable, but I think it might be only used internally for culling. Setting visible false might disable transforms though so if you need the invisible platforms to move or change size you might need to set alpha to 0 instead.

Link to comment
Share on other sites

ive done the visible false but it is classed as non-updateable so player falls through it. Its easy having the scale set to super low but its impacting on memory i may need at a later stage in development and if i need more invisible stuff and i keep setting the scales to super low its going to preload forever and probably lag hard too. I dunno where this renderable code goes. i've put it in places i assume would be correct. its been in:

 

Preload // says undefined

 

Create // does nothing - no errors in Chrome F12 Console

 

Update // does nothing - no errors in Chrome F12 Console

 

Totally stumped because i seen Rich say its in the loop, ive put it there and still rendering as standard...

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...