Announcement

Collapse
No announcement yet.

How to properly setup Velocity based damage in VR?

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

    How to properly setup Velocity based damage in VR?

    To my understanding, you can only get velocity from things Simulating Physics but the problem is that components held by the VR hands or attached to character meshes are not Simulating Physics. I'm using a very clunky workaround method where I have collision spheres (or other shapes) attached to the actual mesh with physics constraints, having those collision objects Simulate Physics and taking the velocity values from those. This is far from ideal and doesn't always work.

    Does anyone have a proper solution to integrating velocity based damage?

    Thanks!

    #2
    Just a guess but Maybe you could find the code in the robo recall modkit download, as it has throwing and hitting stuff already done.
    https://www.artstation.com/alphawolf
    https://www.deviantart.com/alphawolf-uk/gallery
    https://www.youtube.com/user/AlphaWoIFuk/videos

    Comment


      #3
      Originally posted by Kami822 View Post
      To my understanding, you can only get velocity from things Simulating Physics but the problem is that components held by the VR hands or attached to character meshes are not Simulating Physics. I'm using a very clunky workaround method where I have collision spheres (or other shapes) attached to the actual mesh with physics constraints, having those collision objects Simulate Physics and taking the velocity values from those. This is far from ideal and doesn't always work.

      Does anyone have a proper solution to integrating velocity based damage?

      Thanks!
      You can calculate the velocity in World Coordinates of any actor On Tick as:

      (World Location at this frame - World Location at the previous frame) / Delta Time
      CTO | Head of VR Development - Visit us at http://humanxr.com
      My UE4 Tutorials (mostly VR): https://goo.gl/GUvDyV

      Comment


        #4
        Originally posted by vr_marco View Post

        You can calculate the velocity in World Coordinates of any actor On Tick as:

        (World Location at this frame - World Location at the previous frame) / Delta Time
        I'll try that out and get back to you.

        Comment


          #5
          Originally posted by AlphaWolF View Post
          Just a guess but Maybe you could find the code in the robo recall modkit download, as it has throwing and hitting stuff already done.
          That's a good idea.

          Comment


            #6
            Originally posted by vr_marco View Post

            You can calculate the velocity in World Coordinates of any actor On Tick as:

            (World Location at this frame - World Location at the previous frame) / Delta Time
            This is the method we use and it works very well.

            Comment

            Working...
            X