| |
|
Monadic
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 731 |
|
|
| 18 Sep 2016 02:09 AM |
Your lack of questioning and details saddens me. You should know this, orc. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:13 AM |
Hmm. Well what I'm asking is quite simple if using a Motor6D, I could just edit the C1. However, I'm trying to recreate the effect of a door swinging open.
Stand on one foot, then spin around. That is what I mean. |
|
|
| Report Abuse |
|
|
Monadic
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 731 |
|
|
| 18 Sep 2016 02:14 AM |
That's much better. Now wait for someone to help you. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:15 AM |
| Alright. I guess you had rights there to question me. I wasn't very clear, I'll own it. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:24 AM |
@Monadic
Most of your posts aren't helpful
@OP
You could just add an invisible part on the axis you want the door to rotate, group it with the door and set that invisible part as the PrimaryPart and use SetPrimaryPartCFrame() to rotate it on that axis.
Or use math and object/world space: http://wiki.roblox.com/index.php?title=CFrame#Local_and_World_Space |
|
|
| Report Abuse |
|
|
Monadic
|
  |
| Joined: 03 Aug 2016 |
| Total Posts: 731 |
|
|
| 18 Sep 2016 02:25 AM |
They ARE helpful. Look how it helped Orc. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:26 AM |
@Roy
I'd like to not have additional parts; my game is already reaching upwards of 10k parts and MeshParts with intensive collision fidelities. Could you show me an example with the latter? |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:32 AM |
Actually you don't really need what I mentioned earlier, math should do the trick.
local rotation = math.pi/2--how much you want to rotate local offset = CFrame.new(1, 0, 0)--where you want axis of rotation relative to center of object
local cf = part.CFrame * offset cf = cf * CFrame.Angles(0, rotation, 0) part.CFrame = cf * offset:inverse() |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:36 AM |
@Roy
Almost perfect, except like, the corner should never move. It starts moving towards the end ;'( |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:43 AM |
| Could you explain that more or post your code, it shouldn't do that. Make sure you have the offset correct. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:44 AM |
I'm not sure what offset is, only rotation.
local part=script.Parent local rotation = math.pi/2--how much you want to rotate local offset = CFrame.new(1, 0, 0)--where you want axis of rotation relative to center of object
local cf = part.CFrame * offset cf = cf * CFrame.Angles(0, rotation, 0)
local start= part.CFrame
for index = 0,1,0.01 do part.CFrame = start:lerp(cf * offset:inverse(), index) wait() end
I'm just trying to make it turn like a traditional door. However if that isn't possible without manually making like 300+ calculations I'll just go with this. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:48 AM |
Never use decimals as the increment for a loop, it doesn't always work. Just use this instead.
local part = script.Parent
local rotation = math.pi/2--total rotation you want door to move local offset = CFrame.new(part.Size.X/2, 0, 0)
local repitions = 100 for i = 1,repitions do local cf = part.CFrame * offset cf = cf * CFrame.Angles(0, rotation * (1/repitions), 0) part.CFrame = cf * offset:inverse() wait() end |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Sep 2016 02:55 AM |
| Hey Orc, I actually made a model in my inventory for a door that you can use. |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:57 AM |
@Nameless I already have one, but thanks :P |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 02:57 AM |
| https://www.roblox.com/library/503488895/A-Real-Door |
|
|
| Report Abuse |
|
|
|
| 18 Sep 2016 03:01 AM |
| Oh, I see, it has code too. Thanks! |
|
|
| Report Abuse |
|
|