badfitz60
|
  |
| Joined: 03 Sep 2010 |
| Total Posts: 1283 |
|
|
| 21 Jul 2016 04:15 PM |
script.Parent.Touched:connect(function(part) if part:IsA("BasePart") and part:FindFirstChild("MH") then part:FindFirstChild("H").Value = part.H.Value > 0 and part.H.Value-script.Parent.Velocity.magnitude/10 or part.H.Value end end)
I'm trying to make a game where you make vehicles and then battle.
I'm made a simple rudimentary health system that is put into every block in the game (2 values (maxhealth and health) that are controlled by scripts)
The touched script above is placed into every part in the game that does damage to blocks (blades, saws, etc)
What I want to do is when I hit the part, I want to get the specific point of impact onto it.
A way I thought about doing it is, on touch, fire a ray from the parent of the script to the hit object and get the point of when the ray intersects the block the blade it.
The reason I want to do this is because if the blade deals a "killing blow" to the part, it will cut it along the place where the blade hit it.
If there's a way I can do what I said above without getting the point of impact, please tell me what it is!
SHOT BY A BLOODY FRENCH POLICE OFFICER! BLOODY KILLED BY CHIEF INSPECTOR CLOUSEAU! |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2016 04:17 PM |
scriptinghelpers.org/blog/rotated-region-3
scroll down and you'll find what you need
mom wheres the spaghetti | R$19,427 |
|
|
| Report Abuse |
|
|
badfitz60
|
  |
| Joined: 03 Sep 2010 |
| Total Posts: 1283 |
|
|
| 21 Jul 2016 04:18 PM |
@unwarrented
Would it be viable to do that with so many parts in the game?
SHOT BY A BLOODY FRENCH POLICE OFFICER! BLOODY KILLED BY CHIEF INSPECTOR CLOUSEAU! |
|
|
| Report Abuse |
|
|
|
| 21 Jul 2016 04:20 PM |
im not sure, but i would assume so since it's not too complex
mom wheres the spaghetti | R$19,427 |
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 21 Jul 2016 04:23 PM |
I say its pointless to get the position of impact.
|
|
|
| Report Abuse |
|
|
badfitz60
|
  |
| Joined: 03 Sep 2010 |
| Total Posts: 1283 |
|
|
| 21 Jul 2016 04:25 PM |
"I say its pointless to get the position of impact. "
and it's pretty pointless to say that and not give me a solution to my problem.
SHOT BY A BLOODY FRENCH POLICE OFFICER! BLOODY KILLED BY CHIEF INSPECTOR CLOUSEAU! |
|
|
| Report Abuse |
|
|
badfitz60
|
  |
| Joined: 03 Sep 2010 |
| Total Posts: 1283 |
|
|
| 21 Jul 2016 05:16 PM |
@unwarrented
I think I found a problem.
How do I make multiple regions I can check for intersections?
SHOT BY A BLOODY FRENCH POLICE OFFICER! BLOODY KILLED BY CHIEF INSPECTOR CLOUSEAU! |
|
|
| Report Abuse |
|
|
badfitz60
|
  |
| Joined: 03 Sep 2010 |
| Total Posts: 1283 |
|
|
| 22 Jul 2016 05:45 AM |
b
SHOT BY A BLOODY FRENCH POLICE OFFICER! BLOODY KILLED BY CHIEF INSPECTOR CLOUSEAU! |
|
|
| Report Abuse |
|
|