Volume that Pushes Characters in a Direction

Hey all!
I’ve got a question that I’ve been working with all day and i was wondering if anyone could give me a hand with it. Essentially what i want to do is have a volume that pushes any character that enters it in a preset direction.

A good example of the effect I’m looking for is a Conveyor Belt or a Treadmill. If the character runs in the direction it is pushing, they move at double the speed. But if they run against the push direction it halves it.

I’ve just been going in circles with this all day and it may be a simple solution. I just need someone else to help me with another way to approach it.

Cheers!

Hey MrGrr! Thanks for such a quick reply

I’ve been playing around with your recommendation and i’m having some trouble trying to set it up. If you’re able could you make a quick example and show me the event graph?

Thanks in advance :slight_smile:

“Add force” is the node you are looking for.
you will need to create a vector to describe the direction of movement.
Personally i find using a spline is easiest as it has a set start and end point you can reference, and be able to modify it very simply in the editor.

so add a spline component, get the first node in the spline, get the last node in the spline, use a “look at” node based on those, feed the result multiplied by the required force into the “add force” node.

basically every will be pushed from the start node in the direction of the end point of the spline with your required force.

nice and easy :slight_smile:

this is a quick actor i created, add the spline component.
also: try putting a copy of this into your project content folder… i want to see if you can share a full bleuprint asset.
[zipped blueprint][1]

forgot to mention - when you click on the asset there is a spline end, move that in the direction you want the objects to move.

i did a bit of research and it cant be done using normal physics functions… because of how the player controller works.

Awesome! Thanks a bunch man, unfortunately the blueprint wouldn’t import. Although i would really love to see Epic implement that.

I’ve got all the nodes setup, I’m just having some difficulty making it affect the player. Since the project I’m working on has a custom character made using C++ i will have to collaborate with my programmer and get a hand from him. I did try it with the default 3rd Person Blueprint but that didn’t work either.

I’m sure i understand how all the logic works now though, it just isn’t affecting a character. I’ve tried playing around with the ‘Get Overlapping Actors’ node by adding a ‘Get Player Controller/Character/Pawn’ and none of it seems to be working. I’m still fairly new to Blueprints, and I’m just trying to take some load off of our programmer for a deadline.

But thank you so much for your help. Once i find out how to get the player blueprint working with the spline blueprint i’ll post it here as the answer for anyone that might need this again.

Cheers!

I tried to make it easy… you only need to copy and paste the unzipped file into your project folder (with the editor closed), then open up the editor and you should see it in the folder where you put it.

also, the actor you put that code on needs to have a box to be capable of detecting overlaps - no box, no overlap detection

PS - it definately works… can send video, and show the full thing if you have trouble importing the asset.

I must’ve been doing it wrong then, that would be good though. If you’ve got the video.

And yeah the collision box was all i was missing, my programmer got that sorted in like 10 seconds. Works like a charm now! Thanks for all your help MrGrr!

Done.

first part is blank, but oh well. you can see the box/spline and the full blueprint, and see how i placed it in the world, and that it pushes you in the direction of the spline endpoint

Fantastic work, i can’t thank you enough mate.

Playing around with it further i discovered that you cannot rotate the blueprint, So when placing it in the world make sure to scale and not rotate it into place. Then select the spline and move the end point exactly where you want it.

Also since i needed to only have the Conveyor Belt affect the Player and not the Enemy’s Chasing it. So in the ‘Get Overlapping Actors’ Node under ‘Class Filter’ Change that to your character and it will ensure that only that Class is the only character affected. Hence the Class Filter.

http://puu.sh/l0Fzm/8b91aa6982.png