How do I execute two tasks at the same time

I also get this error message: Error Blueprint Runtime Error: Attempted to access rungamemode_C_0 via property K2Node_DynamicCast_AsRungamemode, but rungamemode_C_0 is pending kill from function: ‘ExecuteUbergraph_BPFLOORTILE_LeftCorner’ from node: Client Turned Left in graph: EventGraph in object: BPFLOORTILE_LeftCorner with description: Attempted to access rungamemode_C_0 via property K2Node_DynamicCast_AsRungamemode, but rungamemode_C_0 is pending kill

I’ve been working on a template today which uses instanced static meshes and creates the level procedurally, it was going well - however I gave up on it as the ConstructionScript in UE4 is incredibly buggy and it’s absolutely impossible to work with variables using it. Testing procedural stuff without ConstructionScript so you can see changes on the fly is a pain and would take far too much time, sorry. :frowning:

You’ll just have to play around with it, trial and error is a good method of learning.

As for the error message, it’s most likely trying to cast to an object that is destroyed or is being destroyed.

It is casting to an object that is getting destroyed, but I put a delay on destroy actor and it still give me an error message but at least I get less of them.

So what do I do when something is casting to something that is about to be destroyed?

Use the isValid node (the one which has a question mark on next to name). Only do stuff if it returns true.

Will do!!!

Where do you think I should put the isvalid node???

Just think logically buddy, if the cast is failing because the target actor is in the process of being killed, you’ll want to check if it’s valid before you try and cast to it.

I got it so there are no errors but this happens sometimeshttp://imgur.com/a/MnZoy. Any ideas??? I have spent hours on trying to solve this t section with and tile on blocking from turning.

Any ideas???

Hey sorry for the delayed response. I found some more time to work on an endless runner template, originally I tried to use 100% instanced meshes and only ever 1 actor for the entire level generation - but the math to support all directions became a bit of a pain to work with, so I went with a kind of hybrid. All meshes are still instanced per automatic, but all the logic like collisions and such happen inside the actors themselves.

It needs some work still, especially to make sure everything is cleaned up behind you - but most of the time it works. Here’s a little video of it.

It’s pretty easy to work with, so adding your own assets shouldn’t be too hard. I might release it as a template on these forums if people find it interesting :rolleyes:

(I’m no artist by any means, so fancy glowing stuff usually works haha)

Thats awesome would I be able to download it or are you not done with it yet?

Sure, it’s got some issues I need to first I also intend to add the functionality to easily add obstacles to tiles. Once that’s done I might release it on these forums for everyone to take a look at, it’d be valuable feedback for me as well as to what could be improved and etc.

I’ll do my best to try and explain how it’s all working together, just don’t expect a fully fledged documentation :stuck_out_tongue:

Ok, tell me when you have it done. That’s great that you are putting it out for everybody!!!

Ok, tell me when you have it done. That’s great that you are putting it out for everybody!!!

I was looking to execute two sets of tasks at the same time, or near enough and came across this thread. Whilst I’m sure the original poster has moved on, for any who are looking for a solution to “parallel tasks” here’s what I used - not sure if it’s what you’d call best practice though.

Start with a While Loop, from the While Loop’s Loop Body wire this into a Do N. Set your Do N integer to 2. From the Do N Counter terminal wire this into a Less than Integer node. Set the value in the Less than Integer to 2 also. Wire the boolean **result **from the Less than Integer into the Condition terminal of the While Loop.
From the Do N **Exit **terminal wire this into a Switch on Int node. Wire the Do N Counter terminal into the Switch on Int Selection terminal.
On the Switch on Int node, add more pins and wire from terminal 1 and terminal 2 into your desired “parallel nodes”.

Hope this helps those that want a quick and dirty solution to parallel tasks.

@Adeptus No, because u can execute them on gpu, thus u will be able to execute two task at the same time using parallel processing but I am not sure if this is exists in unreal blueprints

I did it and worked! thank you so much, i was trying to “hide” inside a closet and it has 2 doors so i was having problems when opening both at the same time.