x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

gate blueprint logic in c++

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:

  1. Button sends signal to player pawn (with mesh to build)

  2. function which was bind to the "build" signal triggers

  3. the function will spawn the actor and place a reference into a variable

  4. 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

  5. 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?

Product Version: UE 4.15
Tags:
more ▼

asked Mar 13 '17 at 10:37 PM in C++ Programming

avatar image

LifeArtist
47 8 13 18

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

I think the way you described is fine. I would simply try it out and see if it works, and then later you can improve it if you see performance becoming an issue.

It's very easy to get caught in the trap of "Let me plan this feature/system down to the most minute detail before I write any code", when often times the things you think will be issues - aren't, and the things you didn't see coming a mile away are. :)

more ▼

answered Mar 14 '17 at 02:06 PM

avatar image

ExtraLifeMatt
1.6k 34 14 48

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question