User Tag List

Results 1 to 11 of 11

Thread: Creating a simple punching bag prototype?

  1. #1
    0
    Infiltrator
    Join Date
    Nov 2014
    Posts
    23

    Question Creating a simple punching bag prototype?

    Hello,

    For a project, my classmate and I are trying to create a simple boxing prototype using the HTC Vive. We have successfully set up a project to take the VR headset, and attach boxing glove static meshes to the controllers in virtual space. However, we are having trouble getting any object to respond to any contact between either of the hands. As it stands, the gloves just phase through anything presented to it, even with efforts made to apply collision and boundaries to objects. We're not looking for anything super complex, just a cube or cylinder that pushes away based on how fast the collision is made, and ideally relies on a 'hinge' or central point somewhere above it to vaguely resemble a punching bag. Is there a tutorial or resource that we can study that would show us how to create these collisions and physics within the project?

    If desired, when I get home, I can upload the project files and content somewhere for examination if necessary.

    If time permits we may add a 'score' system to show a numerical value for the hardest punch made in the current session, but that's a whole other topic.

  2. #2
    0
    For the hinge I can only think of physics constraint component (added to the actor blueprint and set up properly), as for the collisions, well an obvious guess would be to double check collisions on the hand mesh as well as mesh you are willing to interact with (perhaps setting both of these to block all would solve this issue for the time being). Upload a project somewhere so I might be able to look it up tomorrow/Friday.

  3. #3
    0
    Infiltrator
    Join Date
    Nov 2014
    Posts
    23
    https://drive.google.com/drive/folders/0B1u8joVwa7m_NGd2V0N0ZlNhdGM?usp=sharing That should work, let me know if it doesn't. Not really sure how to upload UE4 projects anywhere, Dropbox kept chucking up errors.

  4. #4
    0
    Infiltrator
    Join Date
    Nov 2014
    Posts
    23
    Hrm, we're still struggling to get even a box or another object to just be pushed away from the glove. Any additional suggested tutorials or information would be more than helpful. I'll upload footage/screenshots when I can.

  5. #5
    0
    Quote Originally Posted by bart95 View Post
    Hrm, we're still struggling to get even a box or another object to just be pushed away from the glove. Any additional suggested tutorials or information would be more than helpful. I'll upload footage/screenshots when I can.
    So I've downloaded your project and added simple punching bag (cube) actor. The main reason why your objects didn't want to interact with the glove was simply due to "Simulate Physics" not checked on the object. Obviously you can set an object to simulate physics at any given time, however it needs to be set in order for the objects to be grabable/pushable etc. Punching bag (cube) is done with physics constraints. In order to get more realistic behavior you'd need to mess with constraint settings a bit. Have fun !

    Punching Bag project download

  6. #6
    0
    Infiltrator
    Join Date
    Nov 2014
    Posts
    23
    Quote Originally Posted by Shin_ji View Post
    So I've downloaded your project and added simple punching bag (cube) actor. The main reason why your objects didn't want to interact with the glove was simply due to "Simulate Physics" not checked on the object. Obviously you can set an object to simulate physics at any given time, however it needs to be set in order for the objects to be grabable/pushable etc. Punching bag (cube) is done with physics constraints. In order to get more realistic behavior you'd need to mess with constraint settings a bit. Have fun !

    Punching Bag project download
    Thanks! Although now for so.e reason the glove meshes or controllers are not moving at all. We can actually see two pairs of the static mesh in the world when running the game, but not in the pawn nor in the editor. Very odd.

  7. #7
    0
    Quote Originally Posted by bart95 View Post
    Thanks! Although now for so.e reason the glove meshes or controllers are not moving at all. We can actually see two pairs of the static mesh in the world when running the game, but not in the pawn nor in the editor. Very odd.
    Move the player start up a bit.

  8. #8
    0
    Infiltrator
    Join Date
    Nov 2014
    Posts
    23
    Quote Originally Posted by Shin_ji View Post
    Move the player start up a bit.
    Aha, that did it. Some tweaking of the camera and pawn positioning later and we got it working, thanks again! Now to study the implementation of haptic feedback on collision!

  9. #9
    0
    Create a function similiar to the one in VR Template, called Rumble Controller, in your Punching Bag bp call EventHit with a cast to your Pawn and call Rumble Controller function from the Pawn. It's not described precisely but should get you pointed in the right direction.

  10. #10
    0
    Infiltrator
    Join Date
    Nov 2014
    Posts
    23
    Quote Originally Posted by Shin_ji View Post
    Create a function similiar to the one in VR Template, called Rumble Controller, in your Punching Bag bp call EventHit with a cast to your Pawn and call Rumble Controller function from the Pawn. It's not described precisely but should get you pointed in the right direction.
    Thanks, we got rumble working. Sort of. Regardless of which glove hits the box, only one specific controller or both controllers vibrate, we're dissecting the template to try and figure out how it has managed to differentiate it and make the rumble occur on a different controller based on which mesh is making the collision. I suspect it is related to the fact that we have two meshes in the vr pawn but in the template they only have the one that is then mirrored and attached to the other hand. I know we need to define somehow which mesh is colliding to then trigger one of two rumble events.

    The template does have an OnComponentHit event but we can't figure out how to point it to either of our glove meshes or motioncontroller nodes in the vr pawn.

  11. #11
    0
    Quote Originally Posted by bart95 View Post
    Thanks, we got rumble working. Sort of. Regardless of which glove hits the box, only one specific controller or both controllers vibrate, we're dissecting the template to try and figure out how it has managed to differentiate it and make the rumble occur on a different controller based on which mesh is making the collision. I suspect it is related to the fact that we have two meshes in the vr pawn but in the template they only have the one that is then mirrored and attached to the other hand. I know we need to define somehow which mesh is colliding to then trigger one of two rumble events.

    The template does have an OnComponentHit event but we can't figure out how to point it to either of our glove meshes or motioncontroller nodes in the vr pawn.
    Well the template basically mirrors the other hand. They used just one hand model, while other hand is spawned with -1 scale on the z axis, they detected the hands based on the enum iirc.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •