How can I move a door based on character distance?

First of all, I am not the one to judge but this is an unnecessarily long way of doing this.

  • You do not need to get class → get actor of class and so on, you can simply cast the Other Actor to the player character:

  • Or you can make use of Tags and add a simple “Player” tag to the Character:
    image

Now to answer OP’s question, if I got it right, he/she wants a door that will move left/right based on the distance between the player and the door.

To accomplish this, you might do something like this:

Please note that this still will require adjusting to get the desired effect you’d like.

For example, you can use the distance between player & door to calculate the speed of the movement of the door using Lerp:


But as I said, this will still require some adjusting and testing to get the desired effect. However I hope it serves as a valuable starting point!

Good luck.