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"

Blueprint - Push/Add Force to an Object

Hey everyone, I'm brand new to UE4 transitioning from Unity 5. I was working on a game where one of the player's abilities is they can push metallic objects away from themselves. I'm trying to prototype the same mechanic in UE4's blueprints while I learn C++, and I'm having some trouble figuring out how to apply a force to my target object. I have the blueprint set up so far like this: alt text

I'm not sure where to go next. After a bit of searching, I thought SetVelocity might work, I also looked for some sort of Launch command, but couldn't find that. Does anyone have thoughts on how to accomplish this?

Also, I want to have this push action check the target object for an "isMetal" boolean or something similar, to see if the object can actually be moved by the ability or not. How would I go about this?

Product Version: UE 4.19
Tags:
2018-08-28.png (440.7 kB)
more ▼

asked Aug 28 '18 at 08:56 PM in Blueprint Scripting

avatar image

Halocrafter
1 1 1

avatar image Tuerer Aug 29 '18 at 05:54 AM
  1. Launch only applies to Character. For other objects you may use Add Force or Add Impulse.

  2. It depends on HOW you want to push your metallic objects. If just throw it away, Add Impulse would be perfect. Set velocity might work too, actually. You can find a vector from the character to the object and that's how you get the direction of the impulse you need.

  3. If you want to manipulate objects like Magneto in X-Men, that's a bit trickier. Depending on your setup, several options come in mind, but they are more complicated than the first one. Would the first one work for you? =)

avatar image Halocrafter Aug 29 '18 at 06:25 AM

Well if it helps, this is based on a novel series called Mistborn, where the push/pull ability is pretty much the same as force push and pull, but only works on metal stuff. I think Add Impulse would work, based on your description.

I'll give you a link to the wiki page about the ability in question if you want some other reference: https://coppermind.net/wiki/Steel

avatar image Tuerer Aug 29 '18 at 06:51 AM

As I imagine it in real life, Add Impulse is good for pushing, since it can be applied once and then the object will decelerate. As for pulling, I believe Add Force will be better, but that should be used not instantly, but over time based on event ticks, since the object starts moving slow and accelerates towards the character.

avatar image Halocrafter Aug 29 '18 at 06:53 AM

Well I appreciate your input for sure. Just to make sure though, how does Add Impulse work? You have any tips for setting it up properly?

avatar image Tuerer Aug 29 '18 at 06:58 AM

It just instantly adds velocity to one direction. You may choose to ignore the object's current velocity or add to it and it can account for object's mass as well. That's the difference from simple Set Velocity that just sets absolute numbers regardless everything.

avatar image mightyenigma Dec 05 '18 at 05:22 PM

IIRC, SteelPush/Steelpulling obeys the newtonian law of action/reaction, but on a straight line only, so the character may carry a bag of coins and use them in a leapfrogging fashion to pole vault continuously, pushing the coin into the ground (the action) and riding the line of force (the opposite reaction) where the pushing force is now down against the ground, using the coin as the force's point of contact since it's metal.

There is advantage that it only works in a straight line; without this constraint it would be like trying to balance on top of a crystal ball. or more accurately, like trying to stab a chopstick through a crystal ball.

The coin has so little mass that it pushes away from the character without pushing back against the character very much, but with the coin against the ground, the ground has much more mass and therefore pushes the character back. then the character may steelpull the coin back up into her hand and therefore never run out of coins, and continue invisible pole-vaulting like this until the metal powder in her stomach burns out.

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

1 answer: sort voted first

Hi, u can try this https://www.unrealengine.com/en-US/blog/moving-physical-objects

Or add node Physics Angular Velocity (Velocity like variable of Power)

more ▼

answered Aug 29 '18 at 05:39 AM

avatar image

saenko-av
3 1 3

(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