actor freaking out on trampoline

Hey everyone,
I am now having an issure when my actor bounces on my trampoline. When it gets close to the end of the scene (probably within 150px from the end), the actor hits the tramp it shoots it super fast to the right when it should just bounce somewhat straight up.
my scene is 700 px wide
Here is my code
when actor hits trampoline
change attribute
self.motion.linear velocity x to self.motion.linear velocity x+4*(self.position.X - game.mouse.position.x)
I am now having an issure when my actor bounces on my trampoline. When it gets close to the end of the scene (probably within 150px from the end), the actor hits the tramp it shoots it super fast to the right when it should just bounce somewhat straight up.
my scene is 700 px wide
Here is my code
when actor hits trampoline
change attribute
self.motion.linear velocity x to self.motion.linear velocity x+4*(self.position.X - game.mouse.position.x)
Answers
DONT CONSTRAIN TO THE MOUSE POSITION
Do this instead:
In the trampoline
constrain self.linear.velocity.X to (Mouse.position.X-self.position.X)*30
change the 30 to a higher number to make it more responsive and a lower number to make it less responsive.
With this method you will get natural physics!
I think this will give you more natural physics than messing around with a bunch of math (boooo!)
thanks sci tunes I will give this a try.