-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request - Add Simple "Grapple Hook Movement" Functionality #122
Comments
Edit- the files above now have a "working" line mesh. |
I've got it working despite a mostly busted controller. There are some changes I'm looking to make:
The current "mode" appears to be to fire the user towards the hook_point, but then normal physics takes over and the grapple line is just for show. This initially works well, but then the player just falls to the ground. I tried a second "mode" which is to linearly move the player towards the hook_point with physics turned off. This gets the player to the target, but doesn't feel very good. I'm looking into a third "mode" where again the player is thrown towards the target, but essentially the rope is a ratchet which doesn't let the player move further away from the target. Eventually the player would be swinging by the rope until they let go. This would take some interesting vector math. |
@teddybear082 I've put an example with swing mechanics in https://github.com/Malcolmnixon/godot-xr-tools-demo. There's still some more cleanup to do, but could you check it out and see what you think. |
That's awesome will try it out soon! Appreciate your quick work on this! |
@Malcolmnixon Tried it. You're a genius. Your implementation is very slick, love it. Hope this can find its way into the official XR-tools in the next release!! |
I think I want to add one more thing - a "winch" velocity which tries to pull the user towards the target at a slow speed - just need to play with the physics of it a little more. |
@teddybear082 I just did another update and I think it feels a little more natural. There's an initial impulse and a slow winch if you hold the grapple down. I also added simulated air friction to dampen the wild swings. Could you let me know if you're comfortable with the feel of it as well, and if so I'll turn this into a pull request for godot-xr-tools. |
I like it! I personally like how you did it with your last iteration by default but grappling is very subjective and so what is better about this one is all of customization you built in so I was also able to get that feel by adjusting the winch and impulse values with this model and yet this model will also appeal to people who want a different feel. Really great! |
I think the physics of the actual swinging is good; but when I added grappling to my "DemoAll" example with all the movement providers available, I found a few more things need to be fixed:
I'll fix these and then get a pull request going. |
Cool! I forget, do I close the issue or do you? I think we can close this one now. |
The pull request is associated with this feature request, so once the pull request is merged into the main branch a final test is performed and the ticket is closed. Until then we keep the ticket open in case the review finds more work or issues that need fixing. |
Understanding this isn't hugely different from the teleport functionality XR-Tools already has, a simple "batman bat-hook" style of grappling hook where the player is pulled to the "hook" location would be neat to have.
I have a simple version of a movement provider scene and script implementing this here, which I'm sure could be improved upon: https://drive.google.com/drive/folders/1osoVU7tWHyNJwMDtK8jpxOt9aVN4Rsgb?usp=sharing
The user can choose hook speed, which controls how fast the player gets to the hook point (and if low enough, whether the player fully makes it there at all) and hook length to control how far the player can "shoot." Right now there is no mesh like the shooting of a physical hook or line implemented as I haven't figured that out yet, but there is a target, modeled off of the one that is used for the existing Pointer Function (the target is a different shape, a cube instead of a sphere, in case a player had both Pointer-with-target and Hook functions on, to distinguish them).
Note that this is also different from a "spider man web" style grappling system that has a lot more physics and bounce to it, which I don't know how to do.
The text was updated successfully, but these errors were encountered: