Jump to content

Recommended Posts

Posted

I have just noticed a very, very strange bug in my game which also appears to be affecting some of my other games.

 

If I run and shoot (especially with the shotgun from the FPS Weapons Pack) then I actually shoot and injure myself. The faster the player move speed, the more the damage. With a run speed of 5, 50hp is removed from the player.

 

I don't understand why or how this is happening. I'm completely clueless. I have tried using the original player FPS script, have tried loading the player prefab back in etc. Can't seem to get it to work normally.

 

Has this happened to anyone else?

Posted

Ok, after pulling my hair out for hours and hours, I finally figured out what was causing this. And I honestly have no idea why, because it doesn't make sense.

 

A directional light.

 

Deleting the directional light fixed everything. I don't know why, but it did. Now... where did I leave my whisky?

Posted

What FPS are you getting? I think the directional light is causing a performance hit, which means that you are essentially running into the bullet because it doesn't move in time. The bullet is an entity itself so you can have this issue.

Posted

Whoa that is the most interesting bug of all time. It would be easily fixable just by checking to make sure the hit object isn't the player himself.

  • Upvote 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Posted

This is approach is even easier imo. Just use SetKeyValue on the enemies and the player to label them as something. Also, label the bullet so that it has an owner. Then, when you are testing for collisions, you will know what you hit.

Posted

I have the same issue and have for some time. Just haven't got around to trying to figure it out. I am using the FPS Pack from the store. It seems to have started around the time the Merc came out. The Shot Gun hurt's sad.png a lot. I have actually used it to kill me testing re-spawn code. I was my own enemy.

 

Maybe the hitbox is intersecting with the bullet. Possible that the pick point is too close to player hitbox, rotation or speed related? Haven't had time to try to figure it out, this never used to happen to me. I thought maybe it was just some bug I created but it happens with clean install, new project and very randomly.

 

 

BTW loving leadwerks, runs like butter on my machine. So quiet.

 

People who purchased the weapon pack and die by their own weapon may not be to happy.

I will keep an eye on the post's. I know the say's solved but, re-coding the dlc weapons you just bought to use them would have to suck. Especially if you are just getting started and you just bought them. Just sayin.

Posted

Angelwolf, Just tried re- moving light and I still shoot myself. I have child pivots for HUD and game info. I will try moving and removing those next. It seems to occur mostly on first firing gun. Had dropped the vwep prefab into the scene in the past and it seemed to help, but I can still shoot myself. Maybe this will be my focus today.

Posted

just checked an old script and didn't shoot myself. Further investigation shows hitbox for bullets at line 177, FPSPlayer script.

if I translate the zed axis value negitive (-1) I can't seem to be able to shoot myself and the merc can still kill me. I usually do not change the original scripts that come Leadwerks I make a copy so I have reference if I mess up. I changed this line at 181

hitbox:Translate(0,0.9,-1)

 

--Hitbox for bullets

self.entity:SetCollisionType(Collision.Character)

local hitbox = Model:Box(0.5,1.8,0.5)

hitbox:SetPosition(self.entity:GetPosition())

hitbox:Translate(0,0.9,-1)

hitbox:SetParent(self.entity,true)

hitbox:SetCollisionType(Collision.Prop)

hitbox:SetShadowMode(0)

  • Upvote 2
Posted

Increasing your move speed still can effect this though. so 0.5 works with a 2.5 move speed so you may have to adjust this if you require higher speeds. Just implementing a check like they said above is the better choice but for someone with little coding knowledge this is a quick work around.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...