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"

Cannot set actor references in Game Mode

I seem to be unable to set references of actors in scene to variables in my game mode. My custom game mode has a component actor that contains the reference variables, and when I click the drop down and select the actor I want, it doesn't save any changes. It remains as none. I'm not entirely sure what the problems is. Yes, the variables are public and editable.

alt text

EDIT: Updated screen shot

Product Version: UE 4.11
Tags:
untitled.png (133.8 kB)
more ▼

asked Jul 28 '16 at 04:52 AM in Blueprint Scripting

avatar image

GhostRavenstorm
101 33 36 41

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

2 answers: sort voted first

I am not 100% on this but I believe this is because Actors are not the same for all connected players, loaded on client then replicated to represent the servers version, therefore a reference to it in GM would be redundant. You should try make actor references in the Level Blueprint or where necessary for interactivity, the Character or Pawn BP.

more ▼

answered Jul 28 '16 at 07:25 AM

avatar image

TechnicallyLew
134 7 3 7

avatar image GhostRavenstorm Jul 28 '16 at 09:05 AM

Will I be able to get a reference to the level object to get my actor variables then?

avatar image GhostRavenstorm Jul 28 '16 at 09:53 AM

What I've found out is that since Game Mode can't hold references to on scene actors, I'm left with putting those variables in another blueprint. The level blueprint isn't an option because I have objects containing data as actor components which isn't supported in the level blueprint.

My scene calls for 5 actors on scene that change color based on variables contained in these components that are on my custom game mode. What I did instead was instead of the component itself changing the color of a select actor, I put the color changing logic on the actor itself. So its the actor that needs a reference to the game mode instead of the other way around. This is what I have done instead.

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

The problem is, that the GameMode isn't spawned yet. You can only set Reference to other spawned Actors within a spawned Actor. The GameMode will be spawned during runtime, so it simply doesn't exist yet.

You need to get the references differently. One way would be letting the Objects register themselves in their "BeginPlay" function. They can "Get the GameMode" and enter themselves into the Variables you need.

more ▼

answered Jul 28 '16 at 08:51 AM

avatar image

eXi
6.8k 332 184 465

(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