Download

Bullet Ejection

Hey folks,

I am working on a realistic physics-based VR shooter, and I am currently working on ejecting a bullet casing, which is currently an Actor Object. I went the Actor route because I want to be flexible and have options of what I want to do with it in the future (i.e Catch it , or react to different surfaces/etc/etc/etc/etc).

As it stands I am spawning the Casing Actor from a Socket I created on the weapon.
2585a76657e7d555578c3b71d91e57808b313ea3.png

After that I am adding Physics Velocity of -200 in the X axis of the spawned casing. The problem is that X changes depending on what direction you face thus rotating 360 causes the case to eject heading to the left/etc when facing the opposite direction vs. staying true or relative ‘Right’ of the Socket.
809b6c32e56c0f90cc400876e26dd54b59838cf6.png

I know this is a simple issue but I am brain farting it up!

Any thoughts/helps is appreciated it.

It looks like that velocity node is set in world space.

So you want to get the Xvector of the spawning gun and use that as the velocity don’t you? I would create an actor variable in the casing “owning gun” then pass that through on the spawn.

Once the casing has the references to what spawned it you can get the guns direction vector and multiply it by the velocity you want to eject it away from the weapon.