diff --git a/docs/Animation_API.md b/docs/Animation_API.md index a09036209..86472ac2c 100644 --- a/docs/Animation_API.md +++ b/docs/Animation_API.md @@ -4,8 +4,11 @@ You can control animation blueprints variables and events easily: ```py + +from unreal_engine.classes import SkeletalMeshComponent + # get a reference to the skeletal mesh -skeletal = self.uobject.get_component_by_type('SkeletalMeshComponent') +skeletal = self.uobject.get_component_by_type(SkeletalMeshComponent) # get a reference to the animation class animation = skeletal.get_anim_instance() diff --git a/docs/Audio_API.md b/docs/Audio_API.md index a7037e166..95d5665d4 100644 --- a/docs/Audio_API.md +++ b/docs/Audio_API.md @@ -12,10 +12,12 @@ self.uobject.play_sound_at_location(sound, FVector(0, 0, 0)) If you prefer to work with AudioComponent: ```py +from unreal_engine.classes import AudioComponent + class Sounder: def begin_play(self): # find the AudioComponent of this actor - self.audio = self.uobject.get_component_by_type('AudioComponent') + self.audio = self.uobject.get_component_by_type(AudioComponent) self.audio.call('Stop') def tick(self, delta_time): # start the sound when pressing 'A' diff --git a/docs/uobject_API.md b/docs/uobject_API.md index 424ad1c5b..32c760920 100644 --- a/docs/uobject_API.md +++ b/docs/uobject_API.md @@ -200,14 +200,13 @@ return True if the actor has a component of the specified type --- ```py -yesno = uobject.get_actor_component_by_type(uclass) +component = uobject.get_actor_component_by_type(uclass) # alias -yesno = uobject.get_component_by_type(uclass) +component = uobject.get_component_by_type(uclass) ``` return the first component (of an actor) of the specified type -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 --- ```py