Announcement

Collapse
No announcement yet.

How to control 'Set Physics Linear Velocity' using 'get' direction and velocity?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to control 'Set Physics Linear Velocity' using 'get' direction and velocity?

    I can't use physics to bounce around my scene, because it messes up my "Lone Echo' Flinging and Flying' irrevocably (please don't suggest Physics! , been there for months) BUT I have found a way to get a simple BOUNCE when I collide with walls etc. Using Set Physic Linear Velocity. The only problem is it bounces me in a Set direction so as often as not I am unnaturally bouncing back the same ANGLE I came!
    I am hoping before or after the Set Physics Linear Velocity, I can ask Unreal: 'what direction was I coming from before I bumped the wall, and how fast, please make me bounce in the opposite direction at about 1/2 the speed (or whatever is appropriate..)

    MODS: This is not a cross or multi post it is a whole new scenario! and a lot simpler if BP's are what I think they are! I'm sure it will be 'Get Vector' or something, it's after that I wonder how to tell the Set Physics Linear, to be dynamic or reactive to that information I tried switching to Add Impulse and Add Force BOTH of them made me spin a million miles an hour and fly out the scene just as fast Only Set Linear Velocity lets me get a nice little bounce away, (if usually in the wrong angle,..) Here is the area I am working on in a picture:

    THANK YOU all who helped, I guess I got this far on my own, but now I need a LOT less help now so it's easier My image is a little off, it is only the TOP of the 2 Set Physics Linear Velocity that matters, I have returned the bottom one to x=0 y=0 z=0 and it makes no change to my bounce. On that top one, I I also tried stuff like x=5 y=30 z=5 and it gives more direction control but not 'relative' to my incoming vector and speed,..THANKS!


    CTRL to Get and ALT to Set I'm getting this!
    Last edited by NextWorldVR; 08-07-2018, 08:00 AM.

    #2
    Hi again

    Physics can be a pain to get right, so many different variables effects it, the amount of velocity, the objects mass and collision shape etc etc, its a bit of minefield

    So you're not far off I think, in the bottom left of your screenshot you've got that 'mirror by vector' node but it's not connected up to actually run

    On your collider tick the 'generate hit events' under collision section. You'd need to set the collider to also 'block' your static mesh environment objects. You'd need to also set the 'generate hit events' on the environment objects aswell and set them to block.

    You'll need to add in the 'Event Hit' node, hook that up to the 'hit' input on the 'break hit result' node and then use that 'setphysicslinear' node again to set your bounced velocity.

    https://api.unrealengine.com/INT/Blu...Hit/index.html

    actually you might not need the 'generate hit' on your pawn collider as i think that would just notify the hit to the environmental objects.
    Last edited by savagebeasty; 08-10-2018, 09:33 AM.

    Comment


      #3
      Hi
      Try this vid from Mathew... it uses unit direction vector to set rebound ( last part of vid)
      https://www.youtube.com/watch?v=_JCWLsRyz0Y

      Paul G

      Comment

      Working...
      X