File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ # The Tagging API
2+
3+ You can 'tag' actor and components.
4+
5+ A tag is a string (well, an FName internally) you assign to your actors and components. Each of them can have multiple tags.
6+
7+ ## Tagging Actors
8+
9+ The 'Tags' properties allows you to tag actors:
10+
11+ ``` python
12+ your_actor.Tags = [' foo' , ' Bar' , tEsT' ]
13+ ```
14+
15+ You can eventually fast- check an actor for the availability of a tag:
16+
17+ ```python
18+ if your_actor.actor_has_tag(' foo' ):
19+ ue.log(' Success' )
20+ ```
21+
22+ Finding all actors with a tag is unfortuntaley a slow operation (in C++ , Blueprint and obviously python):
23+
24+ ```python
25+ import unreal_engine as ue
26+
27+ def find_all_actors_with_tag(world, tag):
28+ for actor in world.all_actors():
29+ if actor.actor_has_tag(tag):
30+ yield actor
31+
32+
33+ world = ue.get_editor_world()
34+
35+ for actor in find_all_actors_with_tag(world, ' foo' ):
36+ print (actor)
37+ ```
You can’t perform that action at this time.
0 commit comments