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"

Boolean value doesnt change when casted from another BP

First of all, I am only 3 days in UE4 as of today, watched several videos and followed this tutorial to make my own "infinite runner": https://www.youtube.com/watch?v=yS-yQfo0lc0

So the problem is that it won't move if the Boolean isn't set to true from beginning. Tried the overlap trigger, event tic but no success.

Don't know what else to do but to ask for help...

Any suggestions?

alt text

The selected component is the area that should trigger the bridge on pawn overlap

alt text

The overlap event that casts to BP_Bridge to change "Start Moving Component" to true so the "Bridge Component" starts moving 750 units

alt text

This "bridge component" will move as soon as it spawns when the Boolean value is set to true from the beginning

alt text

Bridge component when idle and after moving

alt text

How I am casting to BP_Bridge to get the component moving. Won't work no matter what I try.

Product Version: UE 4.10
Tags:
more ▼

asked Mar 09 '16 at 08:53 PM in Blueprint Scripting

avatar image

Boldimore
5 3 4

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

1 answer: sort voted first

The Other Actor pin refers to the actor triggering the overlap event. Are you sure it's of type BP_Bridge and not player?

You can drag a wire from the Other Actor pin and get it's DisplayName then print it on the screen (node PrintString) to make sure you get triggers coming from the correct actors.

more ▼

answered Mar 10 '16 at 12:58 AM

avatar image

phoboz
1k 38 13 61

avatar image Boldimore Mar 10 '16 at 06:30 PM

I made kinda a breakthrough. Managed to get the bridge moving, but doesn't move always.

Video link: YouTube link

alt text

Currently used in BP_Bridge event graph

alt text

Currently used in BP_FloorTile_Bridge event graph

1.jpg (348.7 kB)
2.jpg (388.0 kB)
avatar image phoboz Mar 11 '16 at 12:16 AM

OK, I'm getting the feeling you don't quite know how to properly use casting.

Casting, in layman terms, can be described as a form of checking whether something is of particular type. More info here: https://docs.unrealengine.com/latest/INT/Engine/Blueprints/UserGuide/CastNodes/index.html

If you're trying to create a new object you need to use Spawning: https://docs.unrealengine.com/latest/INT/Gameplay/HowTo/SpawnAndDestroyActors/Blueprints/

If there is a particular bridge actor (already existing in the scene) that you're trying to move, you will need a reference to that object before you can manipulate it. I suggest you watch this training video about blueprint communication: Training Stream Training Blueprint Communications with Zak Parrish

avatar image Boldimore Mar 11 '16 at 01:07 AM

Thank you for the suggestions! Your feeling is right, I don't quite know how to use it, especially in this particular case!

I did watch that video and did get the idea of using the Dispatcher, but I would like to solve this problem before attempting to do it with dispatcher. And I already have the feeling it making much more sense to use Dispatcher!

I am trying to explain it in the best way I can, thanks for your patience!

Here is another video with me speaking, I hope it does explain what my problem is right now, and what I don't know about casting with that certain node: https://www.youtube.com/watch?v=ioQOvjYxnZs

Sorry for my bad spoken english!

avatar image phoboz Mar 11 '16 at 10:12 AM

One way to do it would be to create a new variable of type BP_Bridge in your BP_FloorTile_Bridge blueprint and make it visible in the details panel (click that eye icon to the right of the variable).

alt text

Then, in the actual scene, you need to assign your particular bridge actor you want to move to that variable.

alt text

Finally, because you now have the reference to the bridge you can just use that variable and set your boolean.

alt text

Couple of notes:

  • When you use boolean variables, they should ideally define the state of something, like IsBridgeMoving

  • You should make a function like StartMoving in your bridge BP and call this instead of setting your boolean, as it is more intuitive (notice that functions names are almost always verbs, to indicate action)

var.png (7.8 kB)
select.png (85.9 kB)
graph.png (85.6 kB)
avatar image Boldimore Mar 11 '16 at 12:10 PM

That's very helpful! Thanks! Didn't even know u can do something like this!

(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