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: Someone explain Vector3, CFrame, and getService to me

Previous Thread :: Next Thread 
camotrooper101 is not online. camotrooper101
Joined: 23 Jan 2012
Total Posts: 44
13 Feb 2016 04:12 PM
I don't comprehend the wiki, my head is also about to explode from reading the wiki.
Report Abuse
camotrooper101 is not online. camotrooper101
Joined: 23 Jan 2012
Total Posts: 44
13 Feb 2016 04:13 PM
It would be great too if you guys are willing to explain the uses of the three
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
13 Feb 2016 04:17 PM
Vector3 just a set of 3 numbers.
Its commonly used for Position but also things like size or velocity.

Its just an x, y, and z put together into 1 value.

CFrame is a set of numbers that represents a position and rotation of an object.


getService() basically checks if a service exists, if it does, it returns the service, if not it creates the service and returns it.


example

Instance.new("Team", game:getService("Teams"))
Run that in the command bar and watch the Teams service pop up.

But run it again and notice it still creates a new 'Team' but not a new 'Teams' folder.
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
13 Feb 2016 04:19 PM
Vector3 is a three-dimensional vector property describing a point in the 3D space. You will find it used for properties such as Position, as the part's position is a point in the 3D space.

CFrame is a much better positional property because it incorporates rotational matrices, so you can set an instance's position and rotation with this one property. You won't find it in the properties panel, but you can set it with scripts. The camera uses a CFrame property called CoordinateFrame.

GetService is a method of the data model, and is used to load in additional services such as the MarketplaceService, ContentProvider, etc. It can also be used to get a reference to existing services, such as game:GetService('Players') is the same as game.Players
Report Abuse
camotrooper101 is not online. camotrooper101
Joined: 23 Jan 2012
Total Posts: 44
13 Feb 2016 04:21 PM
Thank you.
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
13 Feb 2016 04:24 PM
'Vector3 is a three-dimensional vector property describing a point in the 3D space. You will find it used for properties such as Position, as the part's position is a point in the 3D space.'

No Vector3 not a point in 3D space

Its 3 numbers, an x, y, and z
Position uses it for 3D space
Size uses it for...Size
Report Abuse
BanTech is not online. BanTech
Joined: 31 Dec 2015
Total Posts: 886
13 Feb 2016 04:25 PM
Oops
Report Abuse
CrustyCitation5 is not online. CrustyCitation5
Joined: 03 Feb 2016
Total Posts: 155
13 Feb 2016 04:34 PM
Although I suggest against it, GetService is useful if you are changing the names of services.

Changing the Lighting service name to something else can still be accessed by game:GetService("Lighting")
Report Abuse
Happywalker is not online. Happywalker
Joined: 05 Mar 2010
Total Posts: 3672
13 Feb 2016 04:37 PM
Why would anyone change a services's name?

Anyways, Vector3 and CFrame are global tables used for things from posts above
Report Abuse
indeimaus is not online. indeimaus
Joined: 01 Sep 2014
Total Posts: 4285
13 Feb 2016 04:45 PM
Vector3 is just a table value with an x y and z. It's very used for things like size and position. CFrame is vector3 but less restrictive if that makes any sense. If you use Vector3.new for a position if there's anything in the way it will be put on top of that but CFrame.new would put right at the position. CFrame also lets you rotate things but Vector3 can't.

As far as I understand it GetService is used to get things in game from server and local scripts.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
13 Feb 2016 04:53 PM
Why does everyone think that is all that GetService is good for?
GetService will attempt to initialize a service that doesn't yet exist. For example, if I remember right, RunService isn't accessible until you use GetService.


Report Abuse
checkplate is not online. checkplate
Joined: 05 Jan 2016
Total Posts: 1379
13 Feb 2016 05:00 PM
Vector3 is not a point in space, it should be thought as offset from 0, 0, 0
Report Abuse
128Gigabytes is not online. 128Gigabytes
Joined: 17 Apr 2014
Total Posts: 3616
13 Feb 2016 05:09 PM
@Jarod
We both said that...?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
13 Feb 2016 05:17 PM
No, you only thought you said it, and I only didn't think you said it.

Technically though, according to the Observation Effect, it was both there and not there until I actually read your post.


Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
13 Feb 2016 05:44 PM
Lol that's not what that means Jarod

Anyways, OP:

One thing to note is that Vector3 is a datatype for... vectors. Find out what a vector is in the math world, and why it's useful, here: https://www.mathsisfun.com/algebra/vectors.html
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
13 Feb 2016 05:45 PM
I know. The observation effect doesn't apply here.
Although I suppose it could. Anything is possible, we just take the most supported evidences, proofs, and theories to heart.


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