06.04.2019, 11:51
I'm using CreatePlayerObject, and I want for the player that has the object created to shot in the object. How can I do that?
OnPlayerWeaponShoot is not called
OnPlayerWeaponShoot is not called
I already use, but the problem is that, when I shoot in the object, the bullets are not hitting the objects, bullets pass through the object
|
Do you mean an object without (bullet)collision?
If it really has no collision at all, it's not possible to natively detect it, at least with the callbacks. You'd need to check every bullet's line and determine if the object potentially intercepts with it. But that's not very nice to do manually. You could use the ColAndreas plugin to create a fake collision where the object is and check if the bullet (ray) hit it. Even better, if the object has collision but doesn't collide with bullets (like a mesh fence) you can also use ColAndreas (since CA doesn't distinguish between collision types) but use the original object model. The simplest solution however would be trying another object model that does have collision. I'm not sure which object you use and if it can be replaced, but that would make it a lot easier since you could use OnPlayerWeaponShot. |
Okay, I changed the object model, but how can I do that when I shoot in it to remain on the same position (the object is a ball and when I shoot (if it above the ground) the object falls down - and I don't want that).
|