generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Position of impact

Previous Thread :: Next Thread 
badfitz60 is not online. 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
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
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 is not online. 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
unwarranted is not online. unwarranted
Joined: 05 Jun 2009
Total Posts: 1087
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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image