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"

I wanna setting my c++ variable in Blueprint

alt text

I temporarily set the character's altitude.

alt text

Then I took my variables from the blueprint.

alt text

In the game, if I overlap my character with a coin made from a blueprint, I want to raise the maximum altitude, but it doesn't work.

Product Version: UE 4.20
temporarily.png (2.7 kB)
coin.png (267.5 kB)
more ▼

asked May 21 '19 at 06:39 PM in Using UE4

avatar image

1 1 1

avatar image Shadowriver May 21 '19 at 07:53 PM

How do you declare "altitude" variable?

avatar image Dduru_Bok May 21 '19 at 11:32 PM

altitude is an arbitrary variable I declared

avatar image BOBtheROSS May 21 '19 at 08:57 PM

on your second screenshot it seems like your actor won't be able to execute anything after the destruction, because it is destroying itself.

avatar image Dduru_Bok May 21 '19 at 11:43 PM

alt text

Are you saying that changing the order will work?

Actually, I did this first and it didn't work.

avatar image BOBtheROSS May 23 '19 at 09:31 PM

at least now the blueprint can executed that bit of code ;)

if you can't set your altitude float in any way, I'd have guessed (like Shadowriver) that it has something to do how you setup the variable. Another reason could be that some function is always overwriting the value.

In you blueprint I don't understand why you are setting the value of your altitude with it's own value and then adding the altitude score, that you set to a fixed value of 2000 right before that. The first two set functions seem kind of unnecessary, but I don't know your whole code.

avatar image Nebula Games Inc May 24 '19 at 12:57 AM

Yea, that is odd....but maybe the altitude variables are just poorly named. One needs to be pulled from the ABCharacter reference, the other seems to exist in the current BP making me think they are 2 different "altitude" variables. Mixing the C++ into this, one is clearly defined in C++ and one or more could simply be blueprint variables of the same name. Either way, this is a very, very odd setup.

avatar image Dduru_Bok May 24 '19 at 01:54 AM

alt text

I had to solve it this way. I had no knowledge of blueprint and I studied. Thank you

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

0 answers: sort voted first
Be the first one to answer this question
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