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: CFraming

Previous Thread :: Next Thread 
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
15 Jul 2015 02:21 AM
Let's say I have two anchored parts, one is already placed. The other one is being placed by a player holding a tool. How would I check if this second part is through the first part? How do I know there is collision between those two parts? I doubt the Touched event works on this, because you don't actually use physics...
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
15 Jul 2015 02:25 AM
You might be able to use magnitude for this.


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
8BitDeveloping is not online. 8BitDeveloping
Joined: 09 Aug 2011
Total Posts: 1472
15 Jul 2015 02:25 AM
An inefficient way would to be :

function touch(hit)
if hit.Name = "Part1Name" then
print("I'm touching the first part.")
end
end

script.Parent.Touched:connect(hit)

I'm not a very well scripter, still learning, so sorry dude.


"YOU SHALL NOT BLOX!" // Scripter // Developer // ~ Join my primary!
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
15 Jul 2015 02:35 AM
magnitude[2]

just test out how much "distance" needs to be between the 2 parts for them to be touching or nearly touching

mouse.Move:connect(function()
if (partBeingPlaced.Position - part2.Position).magnitude <= 1 then
print("touching..?")
end
end)
Report Abuse
HarrySnotte is not online. HarrySnotte
Joined: 27 Jun 2011
Total Posts: 2854
15 Jul 2015 02:44 AM
Yes, but isn't that a bit hard and inefficient? Because what if the part isn't a cube? Then the x size can be 2 and z size can be 3, magnitude would vary from where the part is oriented relatively to the other part...
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