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"

Why can't I select an actor from my scene?

Hello, When I try to select an actor from my scene to use in my c++ project, I see my actor in the browse menu, but when I click it, the property still says "None". Here is the declaration of my pointer :

 UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "MyGame")
         ADirectionalLight* Sun;

alt text

This was working fine until last night, for no apparent reason. I went and tried to play my game, but the property no longer pointed to my directional light, and I couldn't set it anymore. What could be the problem?

Product Version: UE 4.10
2016-02-15-1.png (22.6 kB)
more ▼

asked Feb 15 '16 at 03:17 PM in Bug Reports

avatar image

10 5 8 9

avatar image Doug E ♦♦ STAFF Feb 16 '16 at 02:29 PM

Hey Dathanar-

What class are you adding your directional light component to? Is this going into a class based on actor, character, game mode, etc.? Can you post the class (.h and .cpp) where you're creating the directional light component?


Doug Wilson

avatar image MutualWolf Feb 16 '16 at 04:26 PM

Hello Doug,

I am adding the component to a subclass of AGameMode. I am not creating the directional light through c++, I am adding it to my level through the editor. I need to access it from my custom game mode to make a day-night cycle.

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

1 answer: sort voted first

Game mode is mainly used for setting the rules of how the game works. Since a day-night cycle would affect the level that you are playing in, the setup for the cycle would best fit in the Level Blueprint. Let me know if the following tutorial helps in setting up your cycle.



Doug Wilson

more ▼

answered Feb 16 '16 at 05:43 PM

avatar image MutualWolf Feb 16 '16 at 05:49 PM

Thanks for your answer, but I wanted to implement this system in c++ rather than in blueprints. Is there a way to do so, or do I have to put all the day-night cycle logic in the level blueprint?

avatar image Doug E ♦♦ STAFF Feb 17 '16 at 02:27 PM

Using the level blueprint would be the least complicated solution. The directional light class in the engine is marked with Minimal API which limits the ability to extend this class / create a pointer to an object of this type. If you are trying to exclusively use code you may find another community member on the forums who has attempted to do so.

(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