Hi, I’m making a game where I need to pass and shot a ball/sphere. In my script the solution I made was the function transform.position, but the “teleport” effect wasn’t what I’m looking for. I need my ball go to a point to another moving with velocity and not teleporting. How I can do this? Any help? Thanks! I put here a small part of my script for any suggestions.
if ( inTrigger ) {
if ( Input.GetKey( KeyCode.Joystick1Button1 ) && !isPassing ) {
StartPass( Pass.transform.position );
}
}
Make sure these variables are defined:
var isPassing : boolean = false;
var timeSoFar : float = 0;
var timeToPass : float = 3; // how long you want the pass to take.
var startPosition : Vector3 = Vector3.zero;
var finalPosition : Vector3 = Vector3.zero;