Why does getting the position of and object return none?

As mentioned before - there will be many ways to accomplish this. Here’s one:

  • Spawning and destroying actors is expensive so the player always has 2 portals:

The CA_Portal is a Child Actor Component that will automatically create an actor.

Instead of laboriously making and destroying portals, you can show / hide them instead. The portals live in the world space (Absolute Rotation and Location) so they can be placed anywhere in the world and will not follow the player.

  • the pure function traces in the direction where the actor is pointing:

We can now place those anywhere:

A portal can talk to the player like so:

There are better ways of doing this but it can be refactored later. Also, it would be much better if the portals were of the same class or, at least, inherited from the same class.


So if Portal 1 wanted to talk to Portal 2 via a direct reference:

This can be optimised, of course, but depends on what we need to do next. Perhaps there should be no logic in the portals themselves, the player could manage them since they know about both from the get-go…

1 Like