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
 

Finding neighbors of a hex

Previous Thread :: Next Thread 
chimmmihc is not online. chimmmihc
Joined: 24 Jul 2014
Total Posts: 2420
01 Nov 2015 12:32 AM
So im trying to cast a ray towards each of the vertices is this the right math?

local function GetNeighbor(Hex, Direction, Ignore)
local Ray = Ray.new(Hex.Position,
Hex.Position + Vector3.new(Hex.Position.X + math.sin(2 * math.pi / 6 * Direction)))
if not Ignore then Ignore = {} end

table.insert(Ignore, Hex)

return game.Workspace:FindPartOnRayWithIgnoreList(Ray, Ignore)
end
Report Abuse
chimmmihc is not online. chimmmihc
Joined: 24 Jul 2014
Total Posts: 2420
01 Nov 2015 12:59 AM
bump
Report Abuse
Riderj is not online. Riderj
Joined: 15 Aug 2011
Total Posts: 1534
01 Nov 2015 01:02 AM
Does it work? Your other post has a few different approaches to your issue.
Report Abuse
chimmmihc is not online. chimmmihc
Joined: 24 Jul 2014
Total Posts: 2420
01 Nov 2015 01:03 AM
so I had this in it:
Hex.Position.Y + math.cos(2 * math.pi / 6 * Direction))

However it only worked in one direction so, I guessing I just need to flip it? idk
Report Abuse
chimmmihc is not online. chimmmihc
Joined: 24 Jul 2014
Total Posts: 2420
01 Nov 2015 01:18 AM
Bump
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