Skip to content
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

Fixed issue where Projectile would spawn at world orgin instead of bullet_point in Godot 4.3 #285

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JohnnyThunder2
Copy link

Hi... first Pull Request ever, figured I would just fix the issue before I brought it up.

I'm on Arch Linux running Godot 4.3, so possibly this is just an issue I'm having but, for some reason the Toy Pistol wieldable would only spawn projectiles at the world origin instead of the bullet_point origin of the player. After adding these two lines of code (Sorry if they are a mess, I'm a novice programmer) it fixed the issue and the Toy Pistol now works as it should.

Line 46 doesn't really do anything, but while I was troubleshooting, I insured the default value was set correctly. Don't believe that line needs to be added.

I'm using Godot 4.3, for some reason (I don't know why), the projectile would spawn at the world origin instead of the bullet_point on the player. These two lines of code set the transform and rotation to the bullet point fixing the issue.
Forgot Comment on line 41.
@Phazorknight
Copy link
Owner

Hey, thanks for this! Will take a look but looks like this should be 4.2 compatible.
If you're using COGITO with 4.3, would you mind sharing your experience in the discussion here: #247

Would be curios if there are any issues you ran into (besides this one 😅 )

@JohnnyThunder2
Copy link
Author

Oh yeah... I'm running into issues... this and one other big one that has to do with the way the guns display, it mostly just works, but I'll detail them over there as best I can.

I didn't even mean to upgrade to 4.3, I'm just new and using Godot and thought "Yeah, it's fine, I'll just use the Arch repo what could go wrong?" and here I am trying to upgrade your repo to work with 4.3, lol...

...I've learned over the years having been on Linux for so long now, it's best to not complain and just fix everything yourself if you can until you're 100% sure you're totally lost. So I didn't wanna file any bug reports until I fixed them like this one.

@Phazorknight
Copy link
Owner

@JohnnyThunder2 I've commented out one line. For me this one caused the projectiles to be spawned facing sideways / wrong direction. Let me know if this changes the behavior much on your end.

If not, I'm happy to merge this in.

@JohnnyThunder2
Copy link
Author

JohnnyThunder2 commented Sep 22, 2024

OK, I have some weird bug. If I comment that line of code out and shoot along the Z axis, the bullet shoots straight, if I turn and shoot along the X-axis the bullet shoots sideways.

I added that line of code and it seems to work correctly for me...

I'm wondering if this is a Godot bug between the Linux and windows build? Need to investigate more.

Edit: You know, I doubt that's the case... I'm probably just doing something wrong... need to study more.

@JohnnyThunder2
Copy link
Author

Yup, yup... I'm a total noob. I rotated the bullet_point 90 degrees in the y axis and forgot I had done so...

Thank goodness, I was just about to dive deep into trying to use Grep to figure out where the global_transform.basis method were in the source code of Godot... lol... OK... will try and figure it out when I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants