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: Applying Pressure to Brick and Tilting

Previous Thread :: Next Thread 
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
18 Aug 2017 09:06 AM
Hello!

I was wondering what the math is behind this, basically, I need a brick to be stationary, but tilt to wherever the mouse's position is on that brick relative to it.


Example:

The mouse is hovering over the right side of the brick, the brick doesn't rotate to face the mouse but tilt's instead. If the player moves the mouse to the lower right, the brick tilts to the lower right with the upper left jutting out.

Any help with this is greatly appreciated! (If you could also explain what each section of the code does, that would be superb because I could then learn from it, thanks!!)


Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
18 Aug 2017 09:18 AM
So you basically want to map mouse movements to make the brick rotate similar to the way an airplane would move?
Report Abuse
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
18 Aug 2017 09:31 AM
If you mean leaving the brick stationary and having it tilt to simulate pressure based on where the mouse is on that brick, yes.


This is what I have right now:

Mouse.Move:Connect(function()
if Mouse.Target and Mouse.Target == workspace.Part then
workspace.Part.CFrame = CFrame.new(workspace.Part.Position, Mouse.Hit.p / 1.1) -- Dividing by 1.1 to minimalize the effect of the movement, works okay-ish, still not what I am looking for exactly..
end
end)


Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine.
Report Abuse
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
23 Aug 2017 09:13 PM
B1

Sorry, still haven't found anything! :(
Report Abuse
Preselect is not online. Preselect
Joined: 30 Jul 2017
Total Posts: 94
23 Aug 2017 09:17 PM
This might be what you're looking for, check it out:

http://wiki.roblox.com/index.php?title=API:Class/BodyAngularVelocity
Report Abuse
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
23 Aug 2017 09:53 PM
Hm, I need the part to be anchored though. It cannot move it's position.

I'm not extremely well versed in body objects, so I might be wrong, but they need the part to be unanchored.
Report Abuse
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
24 Aug 2017 07:58 AM
B2


Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine.
Report Abuse
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
24 Aug 2017 08:54 AM
Okay, so I have made a bit of progress and finally got it to look how I want...however, it does not respond properly.

Here's what I have:

workspace.ExotriumMainMenu.CFrame = CFrame.new(workspace.ExotriumMainMenu.Position) * CFrame.Angles(math.pi * (Mouse.Hit.p.X - workspace.ExotriumMainMenu.Position.X) / 75 *, math.pi * (Mouse.Hit.p.Y - workspace.ExotriumMainMenu.Position.Y) / 50, math.pi * (Mouse.Hit.p.Z - workspace.ExotriumMainMenu.Position.Z) / 75 * -1)

If you put your mouse over the lower left part of the brick and drag it up to the upper left, it responds perfectly. Any other place is completely off.

Could someone help me fix that CFrame above, please? Thanks! :D


Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine.
Report Abuse
Julian_Orteil is not online. Julian_Orteil
Joined: 14 Aug 2012
Total Posts: 968
24 Aug 2017 11:59 AM
B3

Anyone? Even a pointer would be nice..


Sometimes, it's the people no one imagines anything of, who do the things that no one can imagine.
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