I have a problem on how to implement a gate in c++. Is it normal to put gate logic inside the tick function of an actor?
I want to (spawn and) move a building as long as the player does not pressed the left click again the building should be moved to the location of the mouse. I was thinking of something like this:
- Button sends signal to player pawn (with mesh to build)
- function which was bind to the “build” signal triggers
- the function will spawn the actor and place a reference into a variable
- if the left mouse button is clicked place actor and delete reference within variable ← *this would be triggered each time the left mouse button was pressed *
- if the variable is not empty → update actor location to mouse position ← this would be the line within the tick function of the player pawn
Is there a better way of doing it or lets say a relativly official way?