kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
|
| 22 Apr 2014 04:11 PM |
Hey there.
I want my object to *not* bounce off a wall, instead it should try and get through it at all costs. (So, it should keep pressing on it, concealing it's velocity)
What I have at the moment:
local floatForce = Instance.new("BodyForce") floatForce.force = Vector3.new(0, ball:GetMass() * 196.2, 0.0) floatForce.Parent = ball ball.Velocity = moveDirection * 100
while wait() do baall.Velocity = moveDirection * 100 end
And it works as intended. The only problem is that the ball, when trying to get through the wall, keeps bouncing back and forward. It's looking really jaggy. You can try it yourself with the script above.
My question is, can I make my ball move with constant velocity, physically affect other objects (like players) AND not jaggerly bounce of the wall when trying to get through it? |
|
|
| Report Abuse |
|
|
|
| 22 Apr 2014 04:13 PM |
| Try messing with the Elasticity of the part. |
|
|
| Report Abuse |
|
|
kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
|
| 22 Apr 2014 04:16 PM |
| It's the same with elasticity set to 0 and/or 1 |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 22 Apr 2014 04:28 PM |
I know what you mean, I have the same problem in one of my projects. The only thing is can fathom is to not apply the velocity if the parts x/z coordinate is near the wall. i.e
while wait() do if ball.x >= wall.x then return end ball.Velocity = moveDirection * 100 end
Of course, you'd have to factor in the wall and balls widths, but that's the jist |
|
|
| Report Abuse |
|
|
kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
|
| 22 Apr 2014 04:31 PM |
It looks like Friaza somehow did it right in his Naruto Shippuden Ultimate Ninja Storm 3 game with the fireball effect. It doesn't jag like that.
Gee, I wish he, or somebody who found the solution could elaborate here. |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 22 Apr 2014 04:35 PM |
| BodyPosition probably wouldn't 'jag' as much |
|
|
| Report Abuse |
|
|
kamac
|
  |
| Joined: 05 Dec 2008 |
| Total Posts: 153 |
|
|
| 22 Apr 2014 04:49 PM |
| Yeah, but BodyPosition isn't the behavior I need, because if something happens to the ball during the flight and it gets moved a bit to the right (for example), then it will also change it's velocity to reach the point. It would alter it's flight, and that's not desired here :/ |
|
|
| Report Abuse |
|
|