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"

[Paper2D] Removing a sprite using Blueprints?

Hello,

I'm currently working on a 2D Platformer in my spare time. Though I've run into a problem. What I'm trying to achieve is; Whenever I turn off the Blue Switch, the Blue Lasers will disappear.

What I have right now is this:
This is the Blueprint for the Switch. It does change into a different sprite.

Which is referenced and cast to in the Blueprint for the Laser: This is the Blueprint for the Laser. It doesn't remove the sprite so the player can continue. I've tried replacing the "Deactivate" node with multiple other ones, such as changing the sprite and leaving the selection empty, turning it invisible and removing the actor.

If anyone could help me out on this one, that'd be very much appreciated!

Product Version: UE 4.16
Tags:
more ▼

asked Jul 31 '17 at 01:14 PM in Blueprint Scripting

avatar image

CelestialSatyr
7 2 2 6

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

ClelstialSatyr,

Here is my theory: 1) The blue prints are referencing two differnet 'TurnedOff' variables. Hence the second 'TurnedOff' variable is never set to true. 2) The deactivate is not working as you said, you can try flipflop, toggle Active as alternatives.

Hope this helps d0d0

more ▼

answered Jul 31 '17 at 06:20 PM

avatar image

d0d0
477 16 8 18

avatar image CelestialSatyr Jul 31 '17 at 06:28 PM

Hey d0d0,

Once I changed the name of the variable to "TurnedOff1" in the Switch blueprint, the variable in the Laser blueprint changed as well. So I'm pretty sure they're referencing each other.

I also changed the "Deactivate" node to "Toggle Active", but that doesn't help either, sadly.

avatar image d0d0 Jul 31 '17 at 07:34 PM

Celestial, Can you setup a print statement at CastFailed in the Cast To BlueSwitch Industrial level01, a print statement in both True & False pins in the Branch Condition Node and let me know if the print statements are being printed as expected ?

Thanks d0d0

avatar image CelestialSatyr Jul 31 '17 at 07:39 PM

Hey d0d0, I've connected the nodes like this: http://prntscr.com/g2o3yf And it does in fact work: http://prntscr.com/g2o44r

avatar image d0d0 Aug 01 '17 at 01:41 AM

Can you try a seperate string for cast failed and cast not failed. Also can you do the same for the true and false condition ?

avatar image CelestialSatyr Aug 01 '17 at 09:33 AM

Apparently, it's the cast that's failing: http://prntscr.com/g2wazx Might be because of the node that's connected to the object?

avatar image d0d0 Aug 04 '17 at 06:51 PM

Awesome ... so we figured out that the failed cast is the issue .. were you able to troubleshoot further ?

(comments are locked)
10|2000 characters needed characters left

I was indeed, thank you so much for your help!

more ▼

answered Aug 05 '17 at 08:49 PM

avatar image

CelestialSatyr
7 2 2 6

(comments are locked)
10|2000 characters needed characters left
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