system
1
I usually don’t ask for help but I’m trying something new and trying to “launch” a player into the air using a pad that sits on the ground similar to halo and for some reason I’m having trouble with such a simple task. I started out trying an OnCollision RayShoot and figured it would be easier to send a constant ray so the player wouldn’t need to make contact with the pad but instead it just launches my player into the abyss instead of just 20 feet. Here’s my script and any help would be appreciated.
var Range : float = 5;
var Force : float = 5;
function Update()
{
RayShoot();
}
function RayShoot(){
var Hit : RaycastHit;
var DirectionRay = transform.TransformDirection(Vector3.up);
Debug.DrawRay(transform.position, DirectionRay * Range, Color.blue);
if(Physics.Raycast(transform.position, DirectionRay, Hit, Range));
}
system
2
ok I think I just found the problem why I’m struggling with testing my script. Somewhere in the scripting of the first person character controller provided with unity and even 2 of my own character controllers, all 3 do not support rigidbodies. Ive never actually put a rigidbody onto a character controller. If you attach it and you jump and immediately press forward you launch straight up about 500 ft and I’m guessing the longer you hold jump the higher you go. Well thank for your response and I’m going to try and find a work around
system
3
ok thanks. working perfectly now. just wrote all new scripts this morning so I won’t run into that problem on future developments