|
| 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 |
|
|
| |
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 06 Nov 2015 01:19 PM |
| part.CFrame = CFrame.new(partPosition,playerPosition) |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 06 Nov 2015 01:24 PM |
Umm @OldGoldie
Yes it is... It rotates to the player |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|