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: Motor moves on the wrong axis?

Previous Thread :: Next Thread 
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 04:03 PM



The C0 rotates on the axis when I want the C1 to rotate on the axis. Reversing the
C1 and C0 does not alleviate the problem... where am I going wrong?



Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Jan 2015 04:04 PM
http://wiki.roblox.com/index.php?title=Joint#Programmatic_Creation
Report Abuse
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 04:58 PM
From the Wiki:

"Part0 and Part1 refer to the two parts that are connected by the joint. Given two parts either could be Part0 or Part1, it isn’t critically important which part is assigned to each. It is general convention though that if a part is considered a base for the weld (particularly if a motor is involved) then that part is assigned to Part0."

My issue is that both Part1 and Part 0 are free floating objects. Given the physics aspect they are fighting each other, rotating around the axis. Is there any way I can force the rotation of one part around the main axis and not the other? i.e not requiring a part to rotate an axis. Can an axis be a free floating object that takes place of the part 0? The wiki does not describe a solution to my problem.
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Jan 2015 05:00 PM
I don't understand much. But what I do understand seems to be easily explained on the wiki.

Why not just make a non-collideable, transparent, anchored block for Part0?
Report Abuse
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 07:02 PM

---------------------|---------------------
Unanchored part0 | unanchored part1
--------------------Axis-------------------

If both parts are unanchored the base part can also move as a result of the forces
exerted. My issue is that physics comes into play. Is there a way to force part 1
to rotate around part0 even though part 0 is not anchored?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Jan 2015 07:03 PM
I understood that part. I thought you were wanting to replace Part0 with a coordinate.
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
22 Jan 2015 07:12 PM
I love joints and spent months messing with them and filled much of the wiki about them.

However, I cannot, for the life of me, understand what you are describing. At all. In your first couple posts it's as if you are having a problem with the matrix offsets of the joint not rotating on the right axis. Then, in your recent post, it's as if you have a part weight problem.

Which is it...
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Jan 2015 07:14 PM
He seems to think that connected parts are able to defy gravity and stay balanced when it is off of its support base.
Report Abuse
DrMathematica is not online. DrMathematica
Joined: 29 Aug 2008
Total Posts: 27268
22 Jan 2015 07:16 PM
"He seems to think that connected parts are able to defy gravity and stay balanced when it is off of its support base."

Unfortunately, floating objects tend to fall when not anchored :(

If that's the case, though, use BodyPosition to keep it in the air, and BodyGyro to stop the main part from rotating.
Report Abuse
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 07:16 PM
I'll upload what I'm working on to a game to illustrate the problem
Report Abuse
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 07:34 PM
Here is the link, I would really appreciate the help if you could just come see
what I am trying to describe.

http://www.roblox.com/Testing-place?id=26949711
Report Abuse
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 08:17 PM
Just updated the map, adding a body gyro to one of the parts mitigates the problem slightly but not completely.
Report Abuse
Eman1234567 is not online. Eman1234567
Joined: 19 Dec 2008
Total Posts: 6544
22 Jan 2015 08:27 PM
maximum = 45 --Maxes and Mins for forward and reverse will replace with global numbers for upgrades to
reversemax = -16 --interact with
speed = 0 --Speed value that is contained whithin script
special = Instance.new("Weld") --welds a part to the motor that rotates the body
--main rotating part (everything in the model welds to this part), used to offset rotation by 4. (I tried to use C0 and C1 axis offset as well but the problem persisted)
special.Parent = script.Parent.BodyRotation
special.Part0 = script.Parent.BodyRotation1
special.Part1 = script.Parent.BodyRotation
special.C1 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,4,0)
engine = script.Parent.Engine
VehicleSeat = script.Parent.Bodykit.VehicleSeat

wheelf = script.Parent.wheelf --motor that animates front wheel, stuff also welds to this such as the handlebars

weld = Instance.new("Motor")
weld.Parent = wheelf
weld.Part0 = wheelf
weld.Part1 = script.Parent.BodyRotation1
weld.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
weld.C1 = CFrame.fromEulerAnglesXYZ(-1.57,0,0)* CFrame.new(0,1.9,0) --[-3.8 z axis]
weld.MaxVelocity = 0.1 --speed of animation
--[[
left = script.Parent.LeftF --unused portion---------------
weld1 = Instance.new("Motor")
weld1.Parent = left
weld1.Part0 = left
weld1.Part1 = engine
weld1.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
weld1.C1 = CFrame.fromEulerAnglesXYZ(-1.57,0,0)* CFrame.new(-1.5,2,0)
weld1.MaxVelocity = 0.1 --speed of animation
--------------------------------------------------------]]

weld3 = Instance.new("Motor")
weld3.Parent = script.Parent.Engine
weld3.Part0 = script.Parent.Engine --ENGINE IS SET AS BASE
weld3.Part1 = script.Parent.BodyRotation --ROTATING PART SET AS
--weld3.C0 = CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0,0)
--weld3.C1 = CFrame.fromEulerAnglesXYZ(-1.57,0,0)* CFrame.new(0,2,0)
weld3.MaxVelocity = 0.1



function steer() --angular motion (left and right)
if VehicleSeat.Steer == 0 then
weld.DesiredAngle = 0
--weld1.DesiredAngle = 0
weld3.DesiredAngle = 0
engine.BodyAngularVelocity.angularvelocity = Vector3.new(0,0,0)
elseif VehicleSeat.Steer == 1 then
weld3.DesiredAngle = 0.3
weld.DesiredAngle = -0.3
--weld1.DesiredAngle = -0.3
--engine.BodyGyro.cframe = engine.CFrame * CFrame.fromEulerAnglesXYZ(0,-0.314,0)
engine.BodyAngularVelocity.angularvelocity = Vector3.new(0,-2,0)
elseif VehicleSeat.Steer == -1 then
weld3.DesiredAngle = -0.3
weld.DesiredAngle = 0.3
--weld1.DesiredAngle = 0.3
--engine.BodyGyro.cframe = engine.CFrame * CFrame.fromEulerAnglesXYZ(0,0.314,0)
engine.BodyAngularVelocity.angularvelocity = Vector3.new(0,2,0)
end
end

while true do --Fire everything!
wait()
thrust()
steer()
end

Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
22 Jan 2015 08:29 PM
Sorry, I'm pretty tired tonight. If you message me, I will check this in about 8 hours.
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