Why i can't get a reference to my actor

image


any of these work for no reason please help :pray:

Hello, welcome to the community!

When you are calling the function GetControlledPawn, you are missing to specify a target. You need to provide a Controller if you want to ask that controller for its controlled pawn.

Are you trying to move a character to the player position? Maybe you can use “SimpleMoveToLocation” for that. You just provide the IAController of the character that you want to move and the goal vector.

Also, one recommendation when using EventTick. Are you sure that you need to call that function once per frame? If the answer is no, then EventTick is not the best place to call it (Take a look at timers for that).

1 Like

If this is inside the PlayerController blueprint, the “self” for “player controller” works fine.

However, there are other problems here:

  1. There is no execution line between “Event Begin Play” and “Set Timer by Event,” so the event won’t ever get set.
  2. The timer handle isn’t assigned to a variable, so the GC may destroy it before it fires.
  3. The TrackPlayer event doesn’t do anything
  4. The AIMoveTo node TargetActor property is an alternative way to specify Destination. Assuming you have one player pawn and one player controller, you are telling the Controlled Pawn (the only player pawn) to move towards player pawn 0 (the only player pawn) – e g, you’re telling it to move towards itself. Given that it’s already there, it will immediately complete. And then the next tick, you do it all over again!

My money is on #4 being the problem you’re actually asking about, but you should probably think about the others, too.

Hello sorry for the waste of time i found what the issue myself i just have a physique based actor and only a component move not the actor.
Sorry and thanks for the help !