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

Previous Thread :: Next Thread 
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 03:57 AM
In my game, each player has a plot called PLAYERNAMEfloor. They are allowed to place down models, when the model is placed, how can i do a check to see if it is touching the plot, and if it isn't then destroy it.

So like

if not touching plot then
model:Destroy()
end
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Apr 2015 03:59 AM
Instead, check whether where they're placing it is on the plot. Drive their input instead of using that kind of approach.
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:00 AM
@eLunate, how?

Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Apr 2015 04:01 AM
Get the boundaries for the model and compare it to the mouse position.
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:05 AM
But how would i compare.

1.)I get the positions of the corners of the plot
2.) How do i say if it is within the corners?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Apr 2015 04:10 AM
Is Centre+(Extents/2) inside the plot region?
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:11 AM
I don't really understand sorry, is there an easier way like fire a raycast directly downwards and see if it hits the floor or something?
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:13 AM
FindPartsOnRay?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Apr 2015 04:13 AM
Of course. I just avoid raycasting when I don't need to because it's a relatively expensive operation ^^
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:15 AM
How does findPartonRay Work?
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
17 Apr 2015 04:19 AM
Region3 would work really well for this.


I script -~ chimmihc
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Apr 2015 04:19 AM
A lot of additions, subtractions and divisions
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:21 AM
How does region 3 work? <----- Big noob here (i have never needed it before)
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:23 AM
I assume the constructers are the corners of the plot?
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
17 Apr 2015 04:25 AM
The constructor arguments are the lower front extent and the upper back extent
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:28 AM
And then how do i check if when the model is placed it is inebtween these constructors?
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 04:53 AM
b
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 05:19 AM
bb
Report Abuse
udayk8139 is not online. udayk8139
Joined: 25 Aug 2013
Total Posts: 622
17 Apr 2015 05:29 AM
Um, I am not sure about these..
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 05:44 AM
ok...
Report Abuse
yobo89 is not online. yobo89
Joined: 05 Jun 2010
Total Posts: 2341
17 Apr 2015 06:04 AM
Howe do i say if brick intersects into the region 3
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