|
Post by megasteakman on Jan 27, 2020 19:52:28 GMT
Hey everyone! I've been loving the shooter kit, and threw together a hilarious prototype of a Resident Evil style survival horror game in VR where the player is the static camera watching the player AND controlling the player's arms to arm/interact with the world from third person.
You can see how it works here:
Basically I've been having difficulties changing the aiming system to not use the camera/mouse look. I am pretty sure the current behavior is happening on "ShooterMeleeInput.cs" starting on line 851. My current idea is to use a property from the "ShooterWeapon.cs" script called "muzzle" so that instead of racasting from the screen it have an origin of "CurrentWeapon.Muzzle." Nothing I try out quite works however. That said, I am really bad with C#, and am still learning as I go.
It might be easier to throw out the aiming system all together and just have the shoot method call on a different script, but I want to make sure how I do the firing hooks up with the current system (like, do damage, remove ammo, cause recoil, ect.) Anyways, I just wondering if anyone had any ideas on what the best course of action would be as my friend and I have been stuck on this for a few weeks now. Thanks!
|
|
|
Post by Invector on Jan 30, 2020 14:52:42 GMT
If you take a look at the vShooterMeleeInput you will see that we use the muzzle as the starting point and the camera as a reference to the endpoint (where the bullet will go)
aimPosition = camT.position + camT.forward * 100f;
What you can do is replace the camera reference to another reference, for example we do that in the add-on Shooter TopDownController when you check the option 'alwaysAimForward', which makes the controller shot forward:
aimPoint.y = transform.position.y; aimPoint += Vector3.up * Vector3.Distance(transform.position, rightUpperArm.position);
|
|
|
Post by rh4invector on Apr 20, 2020 15:30:57 GMT
If you take a look at the vShooterMeleeInput you will see that we use the muzzle as the starting point and the camera as a reference to the endpoint (where the bullet will go) aimPosition = camT.position + camT.forward * 100f; What you can do is replace the camera reference to another reference, for example we do that in the add-on Shooter TopDownController when you check the option 'alwaysAimForward', which makes the controller shot forward: aimPoint.y = transform.position.y; aimPoint += Vector3.up * Vector3.Distance(transform.position, rightUpperArm.position); And then, how can we stop the camera from zooming in in top-down mode when the character aims? (The mouse scroll wheel can zoom out a little. I'm trying to figure out how to keep the camera zoomed out while aiming (If the player wants.) In other words, free control over the camera-zoom while aiming.
|
|