Is there a way to disable an actor so they (and their children) do not display, tick/process, collide without explicitly going through and setting those states manually? Essentially ‘destroy’ them with ability to bring them back.
You can set an Actor to be Hidden in game via Blueprints. Hidden Actors are effectively removed from level in terms of collision, visibility, physics interactions or tick events, etc. You can then unhide it when whatever condition you want is met.
Hope that helps!
This answers a question I had posted earlier.
When I tried just setting actor hidden in game I couldn’t ever make it visible. When I tried setting visibility of mesh, it worked better.
I don’t know why, but it doesn’t seems to work for me
When I set “Hidden In Game” to true, it just make my actor not visible, but it still have collision, it’s still focuses by AI, and if I don’t unpossess it from my controller, I can still run, attack and so on.
Do you have an idea of what is going on ?
I don’t really know what setting hidden in game is really supposed to do so I can’t help directly. But you can disable collision with a separate blueprint function.
As for AI, that’s something I hadn’t thought of. You could set a variable or interface function or something so that AI can check if you are suppossed to be hidden and ignore you.
Hope that helps.
Yeah, ok, I’ll do it like that.
I’m not certain whether Hidden was doing more previously than it does now, but to properly make an Actor in level “disabled,” you need to do three major things: Set Hidden in Game, Set Enable Collision, and Set Actor Tick Enabled. Hidden in Game and Visible refer to two different things. Visible only means that you can see it in Viewport during editing. Hidden in Game only refers to visibility during game. So you can have an Actor that is Visible while editing and Hidden during gameplay. default is Visible while editing and NOT Hidden in Game for most Actors.
To effectively hide an Actor and remove its collision, you need to explicitly declare both, either with Construction Script or during Play. In 4.7, you can also use a new node, Set Actor (or Component) Tick Enabled, to make sure nothing else is running.
Hope that helps!
Any chance someone could take a few minutes to give us an actor native function to Set Hidden In Game On/Off, Set Collision On/Off and Set Tick On/Off? Would be pretty convenient for object pools and like and wouldn’t take long to do. May just do it myself before too long.
It’s unlikely devs will implement a combo function like that, but it should be easy enough to create one in Blueprints or code in a Blueprint Library and use it across your project. If you decide to develop one and create a pull request, devs can take a look a decide from there.
This simply isn’t true. Set Actor Hidden in Game just prevents it from rendering, but it still has collision and runs actor scripts, which is why you need solution in accepted answer.
is incorrect. Everyone should take answer which was accepted. Here is a pic proving “Hidden in Game” only handles rendering ( stairs are hidden):
This is not right answer. Please fix!
An old thread I know, but google spat it out in answer to my question and it worked perfectly.
I am using this triple: SetActorEnabled>>SetActorEnableCollision>>SetActorHiddenInGame
to swap my player between different character classes and back again (I have a separate character for dialog functions with NPCs)
Engine Version 4.23
I was same problem at Enemy Actor Blueprints, i find a sollution this.
I used “Set Actor Hide in Game-on”, “Set Actor Tick Enabled-off” and “Set Actor Enable Collision-off” the enemy not can run correct on the “NavMeshBoundVolume”…
Then i go the “Movement Component” and switch Off “UseRVOAudiance”
Then other enemy now possible to wald through the other hidde enemies on the nav mesh bound.