Skip to content

Commit d0286c6

Browse files
author
Roberto De Ioris
committed
added subclassing example
1 parent bae68fe commit d0286c6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from unreal_engine.classes import Character
2+
3+
class Hero(Character):
4+
5+
def __init__(self):
6+
self.CapsuleComponent.CapsuleRadius = 117
7+
self.CapsuleComponent.CapsuleHalfHeight = 200
8+
9+
# BodyInstance is a USTRUCT (they are always passed as value)
10+
body_instance = self.CapsuleComponent.BodyInstance
11+
body_instance.CollisionProfileName = 'OverlapAll'
12+
self.CapsuleComponent.BodyInstance = body_instance
13+
14+
self.CharacterMovement.GravityScale = 0.0
15+
16+
def OnActorBeginOverlap(self, other_actor):
17+
print('overlapping with {0}'.format(other_actor))

0 commit comments

Comments
 (0)