Puppet Master Dry Fire Hit

rechnight

New member
Got the puppet master working with UCC, using the Raycast Shooter script, and all working fine until I run out of ammo because the ragdoll still reacts to the clicks. Anyway to solve this issue?
 
Can you give more details as to what the problem is? When the weapon dry fires there isn't a raycast sent.
 
In the weapon, I added the Raycast Shooter script that comes in the Puppet Master to apply the damage and impact on the ragdolls. But when it is out of ammo, the ragdoll reacts to dry firing.
 
I'm not sure what would be causing the reaction since no raycast is sent. This may be some type of a configuration issue with the puppet. You can verify that no hitscan is sent by placing a breakpoint within ShootableWeapon.HitscanFire.
 
Are you able to reproduce it within the demo scene of a fresh project? I am not able to reproduce HitscanFire being called when there is not any ammo left.
 
I think the issue might be with the RaycastShooter script provided with the Puppet Master asset. Below is the whole code:

using UnityEngine;
using System.Collections;
using RootMotion.Dynamics;

namespace RootMotion.Demos {

public class RaycastShooter : MonoBehaviour {

public LayerMask layers;
public float unpin = 10f;
public float force = 10f;
public ParticleSystem blood;

// Update is called once per frame
void Update () {
if (Input.GetMouseButtonDown(0)) {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);

// Raycast to find a ragdoll collider
RaycastHit hit = new RaycastHit();
if (Physics.Raycast(ray, out hit, 100f, layers)) {
var broadcaster = hit.collider.attachedRigidbody.GetComponent<MuscleCollisionBroadcaster>();

if (broadcaster != null) {
broadcaster.Hit(unpin, ray.direction * force, hit.point);

blood.transform.position = hit.point;
blood.transform.rotation = Quaternion.LookRotation(-ray.direction);
blood.Emit(5);
}
}
}
}
}
}

Could you kindly help me with this? Coding experience is close to null.

Thanks and sorry for being such a bother.
 
You should not be using the scripts provided with PuppetMaster. You should instead use the shootable weapon included within the controller.
 
Yeah, I'm messing around with the settings, think I got it. Disabled the script, set the impact layer to Ragdoll, added health script to the body part I want to impact, and create events to. Will see if all works well down this road. Thanks!
 
Got the impact and damage with Puppet Master working in a dumb way, as my coding knowledge is close to null: added health component to the ragdoll body parts, setup the events for each of them depending on the effects I want (eg. impact on head runs event on the character main layer activating Die on the Character Health component, hide the head and instantiate head explosion). Thanks a lot for the help Justin!
 
Top