**EDIT:**This issue has been resolved! Here is the resolution to the weak problem:
I didn’t make a prefab.
Yep, that was it. I thought I had, I had a working launcher…well minus the translating…and moved on. I started worrying about what the CODE was doing to my ragdoll launcher without remembering that in a moment of haste I simply dragged a ragdoll to the scene, targeted it for the INSTANTIATE script and never actually made a PREFAB of the ragdoll and then target the script to instantiate the prefab.
The world space location from the ragdoll hanging in the scene off to the side was getting instantiated along with its location and each instantiate was moving on account of it.
Major whoops on my part, but when I discovered this problem this morning in the lab I was more happy about it being fixed than ashamed of myself. ![]()
Thanks for those who tried to resolve my issue anyway even without having the VITAL piece of data where I hadn’t yet created the instantiate’s prefab. ![]()
Thanks for reading this. I couldn’t get my full point across in the title alone.
My script:
var ragdoll : GameObject;
var projectileSpeed : float = 50.0;
function Update() {
if (Input.GetButtonDown("Fire3")) {
FireCannon();
}
}
function FireCannon () {
var rocketClone = Instantiate(ragdoll, transform.position, transform.rotation);
var brootjoint = rocketClone.transform.Find("Rag_Root/Rag_MidSpine/Rag_Head");
brootjoint.rigidbody.velocity = transform.TransformDirection (0, projectileSpeed, 0);
}
Pic of the situation:
What does work just fine:
It does instantiate the ragdoll prefab no problem
Launches the ragdoll with the Rag_Head joint in front
Launches it on the axis I want and the speed I desire
The Problem I am having:
Each instantiate is created progressively further behind the previous.
Depending on how long it has been since the scene was started the prefab loads more below the intended starting point.
What I mean, is that I have created an empty game object called “RagdollLauncher1” to which I have attached this script. Hoping that it would be my “launch spawn point” and it is…for the first one. However, the second time I hit “Fire3” this new instantiate spawns from a point BEHIND the emptygameobject “RagdollLauncher1”.
So if I hit the launcher 5 times, each ragdoll is created behind the other until inevitably a ragdoll gets instantiated INSIDE my cannon geometry and then even from under neath it.
In the pic below I had a hard time hitting command + 4 and the “Fire3” button fast enough so the ragdolls are already falling down but you can see how the 5th-9th instantiate actually instantiated inside the cannon geometry and got stuck:
The ONE part I have figured out is that TIME from load is the culprit causing the movement.
For instance, if I wait 10 secs to launch my first ragdoll, it will spawn from completely underneath the platform the cannon is on. So, it appears that time is the whole problem.
So, does that mean the Function Update() is the problem?
What in my code is telling it to move in relation to time passed?
What better function ? () should I use in this case that would factor out the time passed issue I am apparently having?
Thank you for your help in advance!

