AController::AttachToPawn

Physically attach the Controller to the specified Pawn, so that our position reflects theirs.

Choose your operating system:

Windows

macOS

Linux

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/GameFramework/Controller.h

Include

#include "GameFramework/Controller.h"

Source

/Engine/Source/Runtime/Engine/Private/Controller.cpp

Syntax

virtual void AttachToPawn
(
    APawn * InPawn
)

Remarks

Physically attach the Controller to the specified Pawn, so that our position reflects theirs. The attachment persists during possession of the pawn. The Controller's rotation continues to match the ControlRotation. Attempting to attach to a nullptr Pawn will call DetachFromPawn() instead.