Jump to content

Any ideas for a shotgun mic type mechanic?


marauder2k9

Recommended Posts

I have been trying to code a shotgun mic in script:-


What it does is when u zoom in through the scope u can hear the sounds being played at the area u point the crosshair, I'm sure we've all seen something like this done in games before. Closest one i could think of is Codename Outbreak or i think metal gear solid v has the same sort of thing too

Link to comment
Share on other sites

I've never really fiddled with listeners before, but I'd say you would create a new 3D listener and switch to it during the "zoom" - maybe use a ray-cast to get your distance, but if you're not actually aiming at something it might give you no coordinates since there will be no collision. I don't know if listeners are exposed in this fashion to script either - just thinking out loud.

Link to comment
Share on other sites

Not sure about that, either - It has to support at least one per client, I'm guessing you'd create the new one and switch the client to use it then switch back to the player's listener. Or perhaps you could just move the player's listener to the new location.

Link to comment
Share on other sites

1) I don't think it's exposed to script.

2) A simple bool would control stuff like what? I'm certain the listener's position is a full 3D transform - position and rotation - so I am not sure where you're going with that. I'm also pretty sure that the listener is assigned to a node in the player model by default.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...