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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Problem with casting

I do not understand why this is not working as it should. I am trying to create a jump pick up so whenever the player (which is a vehicle pawn/Sedan blueprint) runs over said pick up they obtain the ability to jump permanently. I am having a problem with casting the USB pick up blueprint to the Sedan blueprint. IMG_A is the Sedan blueprint. If integer Pickedup (part of the cast) is more than or equal to 1 the branch will carry out the process.

In IMG_B Pickedup IS set to one. I did a test in which if Pickedup was 1 a text would print. When I run over the pick up in game, the text appears clarifying that the integer is set to one but the jumping does not work.

My question here is why isn't the Sedan blueprint not recognizing that Pickedup has been set to one but the USB blueprint does?? WITHOUT the cast, the jump function works PERFECTLY FINE. With the cast it does not. Is my object wild card wrong? (I am a bit confused when it comes to the referencing of things)

[1]: /storage/temp/259378-img-b.png

Product Version: UE 4.20
Tags:
img-a.png (338.7 kB)
img-b.png (236.0 kB)
more ▼

asked Nov 15 '18 at 01:18 AM in Blueprint Scripting

avatar image

Voyager_871
8 2 1 3

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

2 answers: sort voted first

I FIGURED IT OUT YES! I scratched the INT and set a Boolean called IsUSBPicked as untrue as its default inside the sedan. In USB blueprint I did a cast to sedan and set Boolean as to true. THIS fixed my problem. I needed to set the variable inside the sedan rather than the USB blueprint. Also your comment gave me advice to further help me on this. Thank you so much for helping me!

more ▼

answered Nov 15 '18 at 02:18 PM

avatar image

Voyager_871
8 2 1 3

avatar image mightyenigma Nov 15 '18 at 06:50 PM

You're welcome.

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

Do both the USB and the sedan have a Jump enabled variable? Casting doesnt give variables it just tells the blueprint to treat that actor as that class. If the actor is not a child or parent of that class type then the cast will fail.

more ▼

answered Nov 15 '18 at 02:30 AM

avatar image

mightyenigma
3.8k 18 20 20

avatar image Voyager_871 Nov 15 '18 at 02:00 PM

Sedan is the only one with a jump variable. If I Set the jump inside the USB, then sedan will refuse to jump with a simple press. I really do not understand how to create a simple power up that will last permanently.

avatar image mightyenigma Nov 15 '18 at 06:50 PM

They both need to have a way to check if they have jump enabled. You can do that by having them both be child classes of a class that has that variable or you can give each their own (but you'll have to cast and check both classes if you do that).

(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