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 » Scripting Helpers
Home Search
 

Re: Touched Without Event?

Previous Thread :: Next Thread 
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 Mar 2013 06:32 PM
I am moving a part by changing its CFrame, and I want to know if the brick touches any other bricks. I can't use the Touched event because it doesn't fire when it is moved with CFrame, so I need to do something else. Any ideas? Thanks in advance for any help.
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Mar 2013 06:37 PM
You could math it out. It's actually a pretty complicated problem.

Some simple, partial solutions would be to check whether or not any of the corners or center of the part are in the other part and vice versa.
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 Mar 2013 06:39 PM
Hmm... I have a feeling that would cause some serious lag to check every part in the game every time the part moves... Do you know how people do it when they make guns? For example in Call of Robloxia and the bullet physics that can detect if the bullet touches something?
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
29 Mar 2013 06:39 PM
Use this method:

Workspace:FindPartsInRegion3()

http://wiki.roblox.com/index.php/FindPartsInRegion3_(Method)
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 Mar 2013 06:41 PM
@ArbiterOfDeath

The part rotates. Can I rotate a Region3?
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
29 Mar 2013 06:42 PM
You won't be able to rotate, but it is better then nothing. Another option is to rotate an invisible object's CFrame, then position is to the same position before you move the part, and see if there is a collision. Another way would be to scrap the CFrame and use the physics engine found here: http://wiki.roblox.com/index.php/BodyMover
Report Abuse
BlueTaslem is not online. BlueTaslem
Joined: 11 May 2008
Total Posts: 11060
29 Mar 2013 06:42 PM
Region3's can't be rotated, so if you need the CFrame'd part to rotate, that solution will not work.

If you're worried about too many parts to check, the solution you'd probably want is an Octtree, although that fact you'd need to implement one in Roblox probably indicates we're going about things the wrong way :P, although that will indeed possibly make it much faster if it's done right.
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 Mar 2013 06:46 PM
Do bullet physics of games use CFrame or BodyMovement objects?
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
29 Mar 2013 06:50 PM
Most use BodyMovement. That's why sometimes you see bullets flying upwards, or down. But if it is a gun, then you may want to know that some make their bullets instant and use ray casting. Note that to use it you must use a UNIT VECTOR, or you will get random results.

FindPartOnRay: http://wiki.roblox.com/index.php/FindPartOnRay_(Method)
Raycasting: http://wiki.roblox.com/index.php/Raycasting
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 Mar 2013 06:52 PM
I am making a missile that follows a parabola, and I need it to explode on contact. It follows the parabola using CFrame, but I have no idea which BodyMovement object to use. Any suggestions?
Report Abuse
ArbiterOfDeath is not online. ArbiterOfDeath
Joined: 20 Jun 2011
Total Posts: 1458
29 Mar 2013 06:59 PM
Rocket Propulsion: http://wiki.roblox.com/index.php/RocketPropulsion
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
29 Mar 2013 07:03 PM
Okay thanks a bunch, it looks like it will be tricky to learn how to use all of the properties correctly but I will give it a shot. Thanks again!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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