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"

why is my cast to blueprint failing?

Hi, I'm new to UE4 so I'm not sure if what i am doing is correct. I have created a desert style map with a day/night cycle. I wish to make it so that it is too cold to stay outside in the middle of the night and the player must be near fire.

I am using a blueprint 'simple sky' to control the 'sky spheres' sun position. i am then casting from 'simple sky' to the 'sky sphere' to get the sun height value. when the height value is below -0.6 a new variable 'temp cold' starts to count down from 30. ( works fine)alt text

I have then set up a box trigger around the fire. when the player overlaps the box trigger i want to cast to the 'simple sky' (from level blueprint) and set the 'temp cold' back to 30 but the cast is failing. i think it might be the casts object input causing the problem but I'm not sure what i need to connect it to or even if that is the problem.

alt text

Any help would be greatly appreciated!!

Thanks!

Product Version: UE 4.7
Tags:
simplesky.png (138.9 kB)
level blueprint.png (107.0 kB)
more ▼

asked Oct 27 '15 at 02:16 PM in Blueprint Scripting

avatar image

Soundguy
3 2 5

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

1 answer: sort voted first

Hi Soundguy,

Your cast is failing because currently you are not checking any variable to cast. It is reading a NULL value, so effectively your cast reads:

"Cast NULL to Simple_Sky", which will always fail because there is nothing for it to test. Add in a reference to your simple_sky to the input pin of your cast node.

more ▼

answered Oct 27 '15 at 02:32 PM

avatar image Soundguy Oct 27 '15 at 09:47 PM

Problem solved! Thanks for your help and such a quick response!

(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