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.
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?
“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.
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]
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.
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
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!
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
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.