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: BodyPosition and rotational help required

Previous Thread :: Next Thread 
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
16 Apr 2014 02:46 PM
Is there a way to use a bodymover to make a brick constantly face a certain position from where its current position is (so it looks at it you could say and it is unanchored). This is just like how bodyposition makes a brick constantly stay at a position but I want a way for it to constantly face that position.
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
16 Apr 2014 02:52 PM
I'd use BodyGyro
Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
16 Apr 2014 02:57 PM
Thanks, after looking at the wiki, i tried this but it didn't work, any idea why?

while true do wait()
script.Parent.cframe = game.Workspace.Part.CFrame
end



The script.Parent was the bodygyro itself; no rotation occured
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
16 Apr 2014 03:01 PM
Turn up the .maxTorque property
Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
16 Apr 2014 03:06 PM
Ah it worked! It was able to tilt/rotate whenever i rotated and tilted this other Part... However, i wanted it to be constantly pointing towards it which it wasn't doing, how do i do that?
Report Abuse
samy22 is not online. samy22
Joined: 28 Sep 2008
Total Posts: 2181
16 Apr 2014 03:23 PM
Bump
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
16 Apr 2014 03:47 PM
Try

.cframe = CFrame.new(target.CFrame.p)
Report Abuse
powertool is not online. powertool
Joined: 01 Feb 2008
Total Posts: 3771
16 Apr 2014 03:53 PM

Thanks, after looking at the wiki, i tried this but it didn't work, any idea why?

while true do wait()
script.Parent.cframe = game.Workspace.Part.CFrame
end



The script.Parent was the bodygyro itself; no rotation occured


while RenderStepped() do --While true do wait() takes up more space, and while wait() do is identical functionally. While RenderStepped() do gives you a very short wait that lasts one render frame or 1/60th of a second.

--Get the unit vector between your part and the part you're pointing at it, then pass that to the part you're pointing at the other part. Too lazy to dabble in cframing today, and I don't know it well enough.

(partYouArePointingTowards.CFrame.p - partYouArePointingToOtherPart.CFrame.p).unit I believe it is to get the unit vector.

I also believe there is a LookAt or similar property of a cframe in a part, or a PointToWorldSpace or something. You might need to look that up.



end
Report Abuse
RoflBread is not online. RoflBread
Joined: 18 Jun 2009
Total Posts: 3803
17 Apr 2014 06:52 AM
Power, RenderStepped is an event, not a function like wait(). Gotta connect it, man.
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