From the title it isn't really clear, so here exactly what I want to do.
Firstly,
I'm teleporting an object to another location. (Done through a transform.position)
Secondly, (the part where I fail)
Retain the Force/Velocity of the object, but change it's direction.
As a whole,
The object enter the First gate and should jump out of the Second gate relative to where the Second gate is facing.
I've thought of reading my velocity, and give it back to the ball at his exit relative to the space of the exit. But It seems I can only adjust space to Self or World...
Any idea?
Edit
Here a Link to a simple Image depicting what it should do.
Your object's velocity has two logical parts -- the direction, and the magnitude (how fast you're moving). We don't want to change the magnitude, but we will change the direction.
You can use the transform of your second gate to get the direction. I don't know exactly how your gate model looks, but I will assume that its exit is facing in the direction of the positive Z axis. (You can verify this by clicking on the object in the Scene with Local coordinates selected)
So, you would need to do at least two things: change the object's direction to be the same as the second gate, and change the object's position to be same as the second gate. Something like this might work:
MyObject.transform.position = SecondGate.transform.position;
MyObject.rigidbody.velocity = SecondGate.transform.forward * MyObject.rigidbody.velocity.magnitude; // SecondGate.transform.forward is a vector pointing down the positive Z, in local space
Edit:
Saw your answer. The velocity might be getting zeroed because you are not using triggers for your gates or the position change zeroes it in the same tick.
Here's code with trigger gates instead of solid gates, which doesn't require re-instantiating the object and raping the GC: