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: What's wrong with my math?

Previous Thread :: Next Thread 
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 12:20 AM
It positions the brick correctly, but doesn't rotate it correctly :/


local sp = script.Parent
local aimpart = script.Parent.Parent.Torso

while wait() do
sp.CFrame = CFrame.new(aimpart.CFrame.p + Vector3.new(0,3,0)) * CFrame.new(aimpart.CFrame.lookVector)
end
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 12:32 AM
b
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 12:47 AM
b2
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 01:32 AM
b3
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 01:40 AM
b4
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 02:04 AM
b5
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 02:11 AM
b6
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
04 Sep 2014 02:18 AM
Now you're just spamming.
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 02:38 AM
Think what you will, but I still have an issue that I can't fix.
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
04 Sep 2014 02:43 AM
Ok here is what I would do. Usaly when you CFrame a part, it's rotation is changed too. So try CFraming the player's torso to an invisible brick with the right rotation. Or just weld their torso to the brick instead.

I'm not too sure though.
Report Abuse
Roblok1 is not online. Roblok1
Joined: 27 Jul 2011
Total Posts: 2019
04 Sep 2014 02:45 AM
I could be compleatily off topic. Who knows. More loops. Just call me NOOB!
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 03:04 AM
Welding it glitches the NPCs movements, and the rotation of the brick (as far as I know..) is defined by the * CFrame.new(aimpart.CFrame.lookVector)

The * is supposed to add rotation to the position value, which is the first part of it.

But I apparently did something wrong :/
Report Abuse
murcury57 is not online. murcury57
Joined: 30 Jun 2010
Total Posts: 90299
04 Sep 2014 04:17 AM
[ Content Deleted ]
Report Abuse
Kingmouli is not online. Kingmouli
Joined: 28 Sep 2012
Total Posts: 1292
04 Sep 2014 04:18 AM
Try using CFrame.Angles(IDKwhat.CFrame.lookVector)
Report Abuse
Subete is not online. Subete
Joined: 10 Jul 2011
Total Posts: 917
04 Sep 2014 05:05 AM
I fixed it by doing

CFrame.new((aimpart.CFrame.p + aimpart.CFrame.lookVector).p + CFrame.new(0,0,3).p)
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