Skip to content

Commit 31e8dfd

Browse files
author
Roberto De Ioris
committed
2 parents 948825c + 513f8f4 commit 31e8dfd

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

docs/Animation_API.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
You can control animation blueprints variables and events easily:
55

66
```py
7+
8+
from unreal_engine.classes import SkeletalMeshComponent
9+
710
# get a reference to the skeletal mesh
8-
skeletal = self.uobject.get_component_by_type('SkeletalMeshComponent')
11+
skeletal = self.uobject.get_component_by_type(SkeletalMeshComponent)
912
# get a reference to the animation class
1013
animation = skeletal.get_anim_instance()
1114

docs/Audio_API.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ self.uobject.play_sound_at_location(sound, FVector(0, 0, 0))
1212
If you prefer to work with AudioComponent:
1313

1414
```py
15+
from unreal_engine.classes import AudioComponent
16+
1517
class Sounder:
1618
def begin_play(self):
1719
# find the AudioComponent of this actor
18-
self.audio = self.uobject.get_component_by_type('AudioComponent')
20+
self.audio = self.uobject.get_component_by_type(AudioComponent)
1921
self.audio.call('Stop')
2022
def tick(self, delta_time):
2123
# start the sound when pressing 'A'

docs/uobject_API.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,13 @@ return True if the actor has a component of the specified type
200200

201201
---
202202
```py
203-
yesno = uobject.get_actor_component_by_type(uclass)
203+
component = uobject.get_actor_component_by_type(uclass)
204204
# alias
205-
yesno = uobject.get_component_by_type(uclass)
205+
component = uobject.get_component_by_type(uclass)
206206
```
207207

208208
return the first component (of an actor) of the specified type
209209

210-
It has two shortcuts, it can retrieve the actor from a component, and can get a string (instead of the output of ue.find_class('name')) with the class of the component
211210

212211
---
213212
```py

0 commit comments

Comments
 (0)