//============================================================================= // // Called immediately before gameplay begins. // simulated event PreBeginPlay() { // important that this comes before Super so mutators can modify it if (HealthMax == 0) { HealthMax = default.Health; } Super.PreBeginPlay(); Instigator = self; SetDesiredRotation(Rotation); EyeHeight = BaseEyeHeight; }
PreBeginPlay()时会将Instigator设置成Pawn自己,然后Instigator会被其他类更改