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: Crouch function causing me to float?

Previous Thread :: Next Thread 
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
24 Nov 2012 10:56 PM
My goal is to make a crouching position in which the player's legs move. Daxter33 has done this in his paintball game, but when I try to do this my player floats approximately 0.5 to 1 stud above the ground. Can anyone explain this?


for i=1,5 do
wait()
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0*CFrame.Angles(0,0,math.rad(3))
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0*CFrame.Angles(0,0,math.rad(-3))
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0+Vector3.new(0,.15,-.1)
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0+Vector3.new(0,.15,-.1)
end
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
24 Nov 2012 10:57 PM
Name the legs something different.

Want a script? Send me a PM and we'll work out a deal!
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
24 Nov 2012 10:58 PM
Uhh.... That obviously wouldn't work because it'd break the hip motor.
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
24 Nov 2012 11:00 PM
Then change the Part1.

Want a script? Send me a PM and we'll work out a deal!
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
24 Nov 2012 11:00 PM
I made a crouch, and better yet use welds, copy the motors and then place them back when finished.

Want a script? Send me a PM and we'll work out a deal!
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
24 Nov 2012 11:20 PM
I want the legs to move though :3
Report Abuse
CeaselessSoul is not online. CeaselessSoul
Joined: 03 Jul 2012
Total Posts: 7506
24 Nov 2012 11:48 PM
Oi...

Want a script? Send me a PM and we'll work out a deal!
Report Abuse
salsa232 is not online. salsa232
Joined: 02 Oct 2010
Total Posts: 1399
24 Nov 2012 11:50 PM
Reverse the hep motors left where right and right where left try it
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
25 Nov 2012 01:15 AM
I am literally, at this very second, doing to same thing. I made a crouch but my character is floating. I want it to work without changing the Humanoid's .LeftLeg and .RightLeg
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
25 Nov 2012 01:24 AM
Use the C1, not he C0 of the motor.
Report Abuse
Octopus is not online. Octopus
Joined: 26 Feb 2008
Total Posts: 460
25 Nov 2012 01:27 AM
Whether you use the C0 or C1, you still float.
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
25 Nov 2012 01:29 AM
Strange. I've always used the C1 of a joint for any type of animations, and I've never had the issue.
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
25 Nov 2012 01:29 AM
That didn't change anything. My legs still move up when my body should move down.
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
25 Nov 2012 01:29 AM
Late post. Sorry.
Report Abuse
WhoBloxedWho is not online. WhoBloxedWho
Joined: 25 Mar 2009
Total Posts: 4611
25 Nov 2012 01:30 AM
Try changing both the C0 and C1 then. See if that works.
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
25 Nov 2012 01:33 AM
Nope. Still floaty.
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
25 Nov 2012 02:32 AM
Ok so now I have the opposite problem. It's now acting as if I have no legs so my torso touches the baseplate.

Here's my code, maybe you can get something out of it:

if Character:FindFirstChild("Left Leg") then
Character["Left Leg"].Name = "LeftLeg"
Character["Right Leg"].Name = "RightLeg"
Character.LeftLeg.CanCollide = true
Character.RightLeg.CanCollide = true
end

for i=1,5 do
wait(1/30)
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0*CFrame.Angles(0,0,math.rad(3))
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0*CFrame.Angles(0,0,math.rad(-3))
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0+Vector3.new(0,.15,-.1)
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0+Vector3.new(0,.15,-.1)
end
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
25 Nov 2012 02:37 AM
Got it! Really ugly method to do it, but it works.

if Character:FindFirstChild("Left Leg") then
fake = Instance.new("Part", Character)
fake.Size = Vector3.new(1,1,1)
weld = Instance.new("Weld", Character.Torso)
weld.Part0 = Character.Torso
weld.Parent = Character.Torso
weld.Part1 = fake
weld.C0 = CFrame.new(0,0,0)
fake.Name = "Left Leg"

Character["Left Leg"].Name = "LeftLeg"
Character["Right Leg"].Name = "RightLeg"
Character.LeftLeg.CanCollide = true
Character.RightLeg.CanCollide = true
end

for i=1,5 do
wait(1/30)
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0*CFrame.Angles(0,0,math.rad(3))
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0*CFrame.Angles(0,0,math.rad(-3))
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0+Vector3.new(0,.15,-.1)
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0+Vector3.new(0,.15,-.1)
end
Report Abuse
NinjaShadow1 is not online. NinjaShadow1
Joined: 03 Mar 2009
Total Posts: 2689
25 Nov 2012 02:43 AM
One more post. Here's the final function

Crouch = function(bool)
if bool == true then
fake = Instance.new("Part", Character)
fake.Size = Vector3.new(1,1,1)
weld = Instance.new("Weld", Character.Torso)
weld.Part0 = Character.Torso
weld.Parent = Character.Torso
weld.Part1 = fake
weld.C0 = CFrame.new(0,0,0)
fake.Name = "Left Leg"

Character["Left Leg"].Name = "LeftLeg"
Character["Right Leg"].Name = "RightLeg"
--Character.LeftLeg.CanCollide = true
--Character.RightLeg.CanCollide = true

for i=1,5 do
wait(1/30)
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0*CFrame.Angles(0,0,math.rad(3))
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0*CFrame.Angles(0,0,math.rad(-3))
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0+Vector3.new(0,.15,-.1)
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0+Vector3.new(0,.15,-.1)
end
else
if Character:FindFirstChild("Left Leg") and Character:FindFirstChild("LeftLeg") then
Character["Left Leg"]:Destroy()
Character.LeftLeg.Name = "Left Leg"
Character.RightLeg.Name = "Right Leg"
end
for i=1,5 do
wait(1/30)
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0*CFrame.Angles(0,0,math.rad(-3))
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0*CFrame.Angles(0,0,math.rad(3))
Character.Torso["Left Hip"].C0=Character.Torso["Left Hip"].C0+Vector3.new(0,-0.15,0.1)
Character.Torso["Right Hip"].C0=Character.Torso["Right Hip"].C0+Vector3.new(0,-0.15,0.1)
end
end
end
Report Abuse
sycips is not online. sycips
Joined: 21 Mar 2011
Total Posts: 1368
25 Nov 2012 05:22 AM
Its simple, the legs of a robot decide how high the torso will float(doesnt matter where the legs are) my solution is that you should resize your legs to 1,1,1 so the torso will move down. (Also when you resize it reconnent the motors of the legs again). You could also make a second torso which is welded to the original torso and is welded1 stud lower then the original?
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