Announcement

Collapse
No announcement yet.

Getting actor reference in Actor Component?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    You have no idea how many dots you just connected for me... Thank you SO much... I have a lot to learn.

    Leave a comment:


  • replied
    https://docs.unrealengine.com/en-US/...ork/index.html

    Leave a comment:


  • replied
    Originally posted by BrUnO XaVIeR View Post
    It's important to invest some minutes a day into reading Game Framework classes in source and/or API online pages.
    Hmm. Which game framework should I have looked up? Actor component?

    Currently reading Tom Loomans Game framework c++ guide!
    Last edited by Darkloud1989; 03-19-2020, 11:59 AM.

    Leave a comment:


  • replied
    It's important to invest some minutes a day into reading Game Framework classes in source and/or API online pages.

    You make yourself more familiar with what the engine can do and when the API changes it's easier for you to know where and what you have to refactor in your code.

    Leave a comment:


  • replied
    Ah! Feeling like an idiot. Thanks so much EvilCleric!

    Leave a comment:


  • replied
    Simple:

    Code:
    auto myPawn = Cast<APawn>(GetOwner());

    Leave a comment:


  • started a topic Getting actor reference in Actor Component?

    Getting actor reference in Actor Component?

    Hello! I am having an issue getting a reference to an actor in an ActorComponent class... I try to use

    Code:
        APawn* Pawn = TryGetPawnOwner();
        AZephyrCharacter* Character = Cast<AZephyrCharacter>(Pawn);

    I have used this method inside of an AnimInstance class, and it works successfully. I have added #include
    Code:
    "ZephyrCharacter.h"
    #include "GameFramework/Pawn.h"
    To my header file for the ActorComponent as well.

    Any help would be greatly appreciated!

    P.S. I noticed you can not even use the TryGetPawnOwner node in a ActorComponent blueprint either... There must be a way?
Working...
X