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: Making a part look at a player.

Previous Thread :: Next Thread 
Robloxmannnnnnnn is not online. Robloxmannnnnnnn
Joined: 21 Feb 2009
Total Posts: 789
05 Nov 2015 07:55 PM
How would I go about making the front surface of a part 'look' or 'aim' at a player without the part moving forwards or backwards, just rotating?
Report Abuse
Robloxmannnnnnnn is not online. Robloxmannnnnnnn
Joined: 21 Feb 2009
Total Posts: 789
06 Nov 2015 01:08 PM
bump
Report Abuse
chimmihc is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
06 Nov 2015 01:19 PM
part.CFrame = CFrame.new(partPosition,playerPosition)
Report Abuse
OldGoldie is not online. OldGoldie
Joined: 17 Aug 2010
Total Posts: 8210
06 Nov 2015 01:22 PM
chimmic that isn't rotation.

You'll probably want to use lookVector and then rotate it with CFrame.
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
06 Nov 2015 01:24 PM
Umm @OldGoldie

Yes it is... It rotates to the player
Report Abuse
OldGoldie is not online. OldGoldie
Joined: 17 Aug 2010
Total Posts: 8210
06 Nov 2015 01:26 PM
I'm pretty sure .CFrame moves it? Wont you wanna use fromEulerAnglesXYZ?
Report Abuse
NovusTheory is not online. NovusTheory
Joined: 14 Oct 2009
Total Posts: 4532
06 Nov 2015 01:27 PM
You should probably do some more research than...

.CFrame does NOT mean it moves it... CFrame has a Rotation Matrix which means it doesn't NEED to move it
Report Abuse
awesomebawss is not online. awesomebawss
Joined: 30 Aug 2013
Total Posts: 336
06 Nov 2015 02:45 PM
If you want the part to simply "look" at a player, use this
PART.CFrame = CFrame.new(Part.Position,[direction to look at].Position)

If you want it to rotate towards the player, use a BodyGyro. Roblox wikia has a utorial on bodygyros ;3
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