New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
^^^^^^^^^^^^^^^^^^^^^^
^ HB |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
bump
^ HB |
|
dairebJoin Date: 2012-11-16 Post Count: 726 |
model:SetPrimaryPartCFrame(model.PrimaryPart.CFrame * CFrame.Angles(0,math.rad(90),0))
Where "model" is the model you are trying to move
Should work, haven't tested |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
@dai
Is their any other social media you have outside of roblox that I could screenshare you with? I want to show you something the rotation does and want to see if you have any ideas on how to fix it.
^ HB |
|
|
You can post it to your twitter so we can all see it. c:
|
|
dairebJoin Date: 2012-11-16 Post Count: 726 |
I'm on my phone rn, so sadly no.
The rotation will rotate in local space from the primary part, so you might have to take that into account.
Replace the CFrame with:
CFrame.Angles(0,math.rad(90),0) * (model.PrimaryPart.CFrame - model.PrimaryPart.Position) + model.PrimaryPart.Position
Might work better |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
Watch this to see what im struggling with.
https://twitter.com/haydebugRBLX/status/736987566637875200
When I rotate the model it floats in the air. It is colliding with a part on the ground so it just jumps up a few studs for some reason, how might I prevent this from happening?
^ HB |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
:P
^ HB |
|
dairebJoin Date: 2012-11-16 Post Count: 726 |
Is it moving up because of collision?
Or is the PrimaryPart rotated more than just on the y axis? |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
I am pretty sure it is because of collision.
^ HB |
|
dairebJoin Date: 2012-11-16 Post Count: 726 |
If you're using mouse.Hit, make sure mouse.TargetFilter is set to that model.
Then make sure that the thing your placing it on isn't a mesh.
Does it only float after it's rotated?
And does it rotate around the h axis, because in the video it looked like it was flipping upside down |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
I dont think it rotates on the H axis, and it only does that when I rotate it.
^ HB |
|
dairebJoin Date: 2012-11-16 Post Count: 726 |
oops I meant the y axis XD
Is the thing going upside down or no? |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
nope not going upside down.
^ HB |
|
dairebJoin Date: 2012-11-16 Post Count: 726 |
Idk
Direct CFraming shouldn't be affected at all by collisions |
|
EgoMooseJoin Date: 2009-02-04 Post Count: 2896 |
How are you positioning it without the 90 degree rotation. Eg when it works as expected? |
|
New_ItemJoin Date: 2012-01-21 Post Count: 5667 |
@EgoMoose Oh hey friend, thanks for the lerp tutorial again but I am positioning it normally using :SetPrimaryPartCFrame
^ HB |
|
EgoMooseJoin Date: 2009-02-04 Post Count: 2896 |
Sorry, some clarification, the cframe value you're passing as that argument?
What I'm trying to suggest is that you store an "origin" cframe so to speak and just rotate on that.
Eg:
local origin = CFrame.new(mouse.Hit.p);
local currentRot = 0;
userinputservice.InputBegan:connect(function(input, process)
if input.KeyCode == Enum.KeyCode.E then
currentRot = currentRot + math.pi/2;
model:SetPrimaryPartCFrame(origin * CFrame.Angles(currentRot, 0, 0));
end;
end;
Ya digg? |
|