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

Previous Thread :: Next Thread 
Brickagon is not online. Brickagon
Joined: 01 Jun 2015
Total Posts: 366
10 Jun 2015 02:02 AM
local Surface = Mouse.TargetSurface
local Add = Vector3.FromNormalId(Surface)

local Position = Mouse.Target.Position
local NewPosition = Vector3.new(Position.x + Add.x, Position.y + Add.y, Position.z + Add.z)


Basically I'm trying to get NewPosition to be 1 stud away from the surface in which I clicked. The above works ONLY when all bricks are facing their default directions, but when they are facing a different direction, it fails.

How can I make this work no matter the direction?
Report Abuse
Brickagon is not online. Brickagon
Joined: 01 Jun 2015
Total Posts: 366
10 Jun 2015 03:05 AM
Bump
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
10 Jun 2015 03:15 AM
CF * CF (or * V3 to get a V3 returned)
Report Abuse
Brickagon is not online. Brickagon
Joined: 01 Jun 2015
Total Posts: 366
10 Jun 2015 01:07 PM
Elaborate please.

local Coord = Mouse.Target.CFrame
local NewPosition = Vector3.new(Position.x + Add.x, Position.y + Add.y, Position.z + Add.z)

What am I multiplying together? Coord and NewPosition? It doesn't matter whether I get a CFrame or Vector3 returned.
Report Abuse
Brickagon is not online. Brickagon
Joined: 01 Jun 2015
Total Posts: 366
10 Jun 2015 01:27 PM
Got it working.
Multiply the rotated block's CFrame by the NormalId Vector
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