How to make cRPG camera?

Many things can go wrong in this setup:

We don’t know what triggers the above - if we start accessing the reference before it’s set (and axis events fire every frame), you will see errors.

Add a isValid check to the both axis events.

or

Ensure the actor is spawned before we get to change to read inputs from the axis.

Here is the Set UP:

  • Tick Event,Press A/S/D/W can spawn BP_FreeLook, and Do Once;
  • W/S move BP_FreeLook Forward/Backward;
  • A/D move BP_FreeLook Left/Right;

You mean use Event BeginPlay to spawn BP_FreeLook? I try it, indeed everything goes well.

And why… the different is Tick event? Just like you say:

In my view(maybe wrong, i really want to figure it out), before I pressed A/S/D/W, no BP_Freelook exist, no event like freelook camera moving left/right/forward/backward execute, no error. And after I pressed A/S/D/W, spawn it and set it, the freelook camera exist only once(casue Do Once). Then i continue to press A to move the reference i set before, i don’t know where goes wrong :confounded:

The function I want to achieve is that when the player uses the mouse to click to move, the character’s camera will follow with the player’s movement, but once the player pressed the W/A/S/D, this time the free camera will appear and replace the character’s camera, and player can control the free camera by W/A/S/D.

I fix it! I know what the problem is!