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: Adding Eulerangles into this?

Previous Thread :: Next Thread 
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
24 Jul 2013 12:48 PM
function Place(Spot,Foot)
ap = Foot.Parent:GetChildren()
local P = Foot.Position
Foot.CFrame = CFrame.new((Spot.Position+Vector3.new(0,Spot.Size.y/2,0))+Vector3.new(0,Foot.Size.y/2,0))
P = P-Foot.Position
for i=1,#ap do
if ap[i].className == "Part" and ap[i] ~= Foot then
ap[i].CFrame = ap[i].CFrame-P
end end end

This function allows me to place towers in my element td game. It works, and I like it. Recently I decided I wanted to reduce the number of players from 8 to 6 to try and reduce lag, but in order to do that and still allow players to communicate freely I wanted to arrange the maps into a hexagon grouping, meaning 4 of the maps are going to be rotated. I assumed that the towers, when built, would rotate automatically due to the cframe but I was wrong. This caused skewed towers, towers that didn't line up with the map spots. Now, while it doesn't cause problems, it is an eyesore. I have always been upside left and inverted when it came to euler angles. The whole thing just confuses me.

Can someone help me to rotate the tower based on the direction of the FrontSurface of the spot? The spots the towers are built on and the feet of the towers are always TopSurface up, so if that helps simplify things then great.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
24 Jul 2013 12:51 PM
or CFrame rotation, idc which. I just wanna rotate the tower to line up with the spot.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
24 Jul 2013 01:12 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
24 Jul 2013 05:48 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
24 Jul 2013 10:45 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
25 Jul 2013 09:43 AM
bump
Report Abuse
mrmrluaa3 is not online. mrmrluaa3
Joined: 25 Jun 2013
Total Posts: 122
25 Jul 2013 10:54 AM
3.0 body e_o
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
25 Jul 2013 12:14 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
25 Jul 2013 04:25 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
25 Jul 2013 06:40 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
25 Jul 2013 07:24 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
25 Jul 2013 08:59 PM
bump
Report Abuse
Iwannastaynew222 is not online. Iwannastaynew222
Joined: 08 Jan 2011
Total Posts: 239
25 Jul 2013 09:44 PM
Most bumps I've ever seen. That's impressive.

Cakes always lie. That is the truth. I am a cake.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
26 Jul 2013 12:53 PM
bump o.o
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
26 Jul 2013 02:21 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
26 Jul 2013 02:59 PM
Yeah but I wouldn't have to bump so much if someone would help :(
I usually try to do things on my own but when I get stumped really badly I come here. I don't always get the help I want. Sometimes I do, but most of the time the solution hits me before someone answers. This one is different. I simply do not know how to rotate the tower based on the direction the spot is facing.
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
26 Jul 2013 05:35 PM
bump
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
26 Jul 2013 06:52 PM
bump

(You know, I can do this for the rest of my life :/ )
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
27 Jul 2013 12:28 AM
bump
Report Abuse
onetimeaccount123 is not online. onetimeaccount123
Joined: 20 Oct 2011
Total Posts: 189
27 Jul 2013 01:35 AM
Honestly, the script thing you have looks kinda confusing or at least without the whole script it is. If you want to get a certain part to look towards a point you just have to do something like this:

Workspace.Part.CFrame = CFrame.new(Workspace.Part.Position,Vector3.new(whereyouwanttolook))

I know it doesn't solve your problem but it should help you get started. You might also want to brush up on lookVector cuz that'll probably be the most essential thing to learn about for your situation. Oh yeah and how are you able to make that script but not understand angles >_> it looks so complicated...

Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
27 Jul 2013 03:14 AM
*CFrame.new(0,math.pi/3,0)
Report Abuse
xXxMoNkEyMaNxXx is not online. xXxMoNkEyMaNxXx
Joined: 03 Oct 2008
Total Posts: 3120
27 Jul 2013 03:15 AM
Angles*
Report Abuse
xiaoxiao181 is not online. xiaoxiao181
Joined: 14 Aug 2008
Total Posts: 5882
27 Jul 2013 10:27 AM
@onetime, telling it a specific direction to point would be useless.
it would work maybe for one map, but not the other 5.

@monkey, rotating the parts on Y angles would simply tilt the towers on their sides
Report Abuse
tdog158 is not online. tdog158
Joined: 08 Jul 2008
Total Posts: 5413
27 Jul 2013 10:40 AM
Manually rotate with a rotation tool and take note of the part's rotation. Or rework your system so it's easier for you to use.
Report Abuse
onetimeaccount123 is not online. onetimeaccount123
Joined: 20 Oct 2011
Total Posts: 189
27 Jul 2013 11:47 AM
@xaio again, what you said confused me in a way and I can't visualize the problem but what I imagined was that you wanted a hexagon with all of the towers looking inward to the center of the hexagon. If you apply the thing that I mentioned above, then you could have all of the towers looking at the same point in the center.
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