|
| 23 Sep 2017 06:16 PM |
I need to be able to do something like this:
Part.Touched:Connect(function(Touch) print(Touch:GetFullName().." hit "..Part:GetFullName().." at the speed "..HitSpeed) end)
HitSpeed would be how fast it got hit at.
Thanks.
R$100 R$100 R$100 R$100 |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2017 06:22 PM |
--Touch.Velocity?
--Or maybe you could so this
--Touch.CanCollide=false
pos1=Touch.Position wait(.1) pos2=Touch.Position
local speed=(pos1-pos2).magnitude/100*60*60 print('Touch is moving at '..speed..'mph')
idk hope that helps :\
|
|
|
| Report Abuse |
|
|
cabbler
|
  |
| Joined: 19 Jun 2015 |
| Total Posts: 735 |
|
|
| 23 Sep 2017 06:41 PM |
Part.Touched:Connect(function(Touch) print(Touch:GetFullName().." hit "..Part:GetFullName().." at the speed ".. tostring(Touch.Velocity.Magnitude)) end) |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2017 11:04 PM |
Touch.Velocity.Magnitude
Didn't even know that existed lmao
^he knows whats up |
|
|
| Report Abuse |
|
|
|
| 23 Sep 2017 11:45 PM |
.Magnitude of vectors is the distance of the vector from (0,0,0)
velocity is just a vector3 value so velocity.magnitude is the distance of the velocity's force from 0,0,0 which is basically its velocity as a single number
|
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 23 Sep 2017 11:49 PM |
| Is no velocity lost before the .Touched event is fired, cabbler? |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 24 Sep 2017 12:18 AM |
| I'd assume that Touched will fire after the collision is solved. |
|
|
| Report Abuse |
|
|
Soybeen
|
  |
| Joined: 17 Feb 2010 |
| Total Posts: 21462 |
|
|
| 24 Sep 2017 12:25 AM |
So the part passed to the function will have the post-collision velocity?
|
|
|
| Report Abuse |
|
|