+1 vote

I'm working on a small project to help me learn godot and get more familiar with the project/asset pipelines. It's a mount and blade-lite experience: the player controlled character (followed by a third person camera) moves around a 3D terrain and kills enemies with medieval weapons. However, my issue is that I have weapon component scenes that are combined into weapon scenes so I can easily create different types of weapons (a spear uses the same animation whether it has a wooden tip, metal tip, or is just a staff), which works great but when I strike someone with the spear for example, the motion of the spear tip is not carried back to the player character, meaning that the player character keeps moving while the spear tip is jammed up against the enemy character's collision box. Resulting in the spear tip floating around in the air rather than staying in position on the handle.

All of these are built with kinematic bodies, and I'm using moveandcollide to check for the spear tip's collision.

Is there an easy way to fix this? Or what methods would you all recommend I use to fix it? The options I've thought of were: trying to always update the location of the spear tip in local space, extending the collision code to stop the movement of the player character or somehow "slide" them with the collision (I want to avoid this though as it seems like it could make combat very jerky and unresponsive), or simply scrapping my idea for weapon components and using a single geometry with manually defined hitboxes and such (increasing the amount of work exponentially for any new weapon types or configurations, while possibly leaving the same behavior, just with the entire weapon). Anyways, I can post my collision code if it'd be helpful, and looking forward to seeing you guys' input on it! Thank you so much!

in Engine by (13 points)

Were you able to solve this? I ran into the same issue (in 2d) and my current workaround is on startup reparenting the collision nodes to the parent. Feels very against the concept :/

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.