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: Raycasting stuff

Previous Thread :: Next Thread 
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
10 Nov 2016 08:40 PM
So I'm trying to make rays go through objects acting as bullets I want to do the following: Go through all objects in its path, but still recognize that it collided with them. Is there a way to do this or is it impossible? Basically I will be ############ this by doing the following: Get a list of parts the ray went through in order of first to last Find the ########### distance of each part that the ray went through, reduce a value in the script based on the ########### resistance of that parts material, and continue to do this until I know which part stopped the ray. This will be used for a gun to have semi-realistic material ############
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
10 Nov 2016 08:41 PM
First hashtag:

impl 3 mInt eng

the rest:

pen of trait ing
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Nov 2016 08:42 PM
raycast and have a table of previously hit objects for your ray to ignore
after that check the thickness of the object using dot product maybe? then just use the density of the object
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
10 Nov 2016 08:45 PM
That's along the lines of what I was thinking. What is "dot product" for the thickness issue though?
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Nov 2016 08:46 PM
so i guess you can check the thickness of the object (at its current rotation) based on the direction of the bullet
Report Abuse
S1xty is not online. S1xty
Joined: 25 Oct 2009
Total Posts: 2712
10 Nov 2016 08:48 PM
Ok I think I understand it now

thx
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
10 Nov 2016 08:48 PM
an example ignoring the rotation of the brick:

lets say bullet was going straight forward

into a wall with size 3,2,10 and no rotation

print(math.abs(Vector3.new(3,2,10):Dot(Vector3.new(0,0,-1))))
--remember this is without considering the parts rotation

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