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
 

Weird humanoid physics

Previous Thread :: Next Thread 
1waffle1 is online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
29 Apr 2012 07:33 PM
So there's a bunch of humanoids walking around on a planet. All they are programmed to do is walk around in random directions, and change their direction if they walk into something. If you decide to visit that planet, though, then they all stop flop and drop for no apparent reason. Why would this ever happen?
Report Abuse
1waffle1 is online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
29 Apr 2012 07:36 PM
After you leave the planet, they get up and start walking again. I don't understand why this is happening.
Report Abuse
IAmNotWise is not online. IAmNotWise
Joined: 28 Jul 2011
Total Posts: 1418
29 Apr 2012 08:32 PM
[ Content Deleted ]
Report Abuse
1waffle1 is online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
29 Apr 2012 10:20 PM
No, it's happening at http://www.roblox.com/Planet-Creator-Creating-place?id=12158971
but you wouldn't be able to see it if you went there until you collected the Aurum planet.
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
30 Apr 2012 02:22 AM
It might be a coding problem. Actually, it probably is.

I have no idea what it would be though. Perhaps it's also a mass setoff? Seems wierd w/ anchored bricks.
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
30 Apr 2012 05:46 AM
Do they try to chase you or something? like do they notice if you come close?


It might be that they get in your local computin area and that makes them fail for some reason.
Report Abuse
HotThoth is not online. HotThoth
Forum Moderator
Joined: 24 Aug 2010
Total Posts: 1176
30 Apr 2012 11:57 AM
Yeah, that sounds like a simulation region problem-- if it worked fine on the server alone, then this means that the Humanoid is being scripted from a normal (server-side) script. However, when your player gets near, your player starts simulating the Humanoid, so the scripter needs to make sure that his script is still communicating correctly with the Humanoid when it's on a different machine.

The main things are really just to notice that the precision of the numbers will be a little less (so if you have any x == 0, you might need to change those to math.abs(x) < .03 or something like that), and most importantly to use functions which replicate over the network.

The big one to note is that :SetDesiredAngle(x) will *always* break if it's not on a Player's Character. Instead just use .DesiredAngle = x, and that should fix it. I think this is probably the most common one, but I listed the other since that caused me some issues in a script of mine a while back.

Hope that helps!
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
30 Apr 2012 12:00 PM
>The big one to note is that :SetDesiredAngle(x) will *always* break if it's not on a Player's Character.


Why create useless methods when you can change the value straight?
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
30 Apr 2012 12:14 PM
I think it wont lag for the client or something.
Report Abuse
1waffle1 is online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
30 Apr 2012 04:00 PM
All I'm doing is making them walk around. They have absolutely no affiliation with the players in the game. All they do is walk and turn around if they touch something. When you visit their planet, they flop around and then play dead, which isn't supposed to happen. Then they get up and walk around again once you leave. It doesn't make any sense.

I don't see how it could be a coding problem - something this complicated wouldn't just come up out of a spelling error.
They don't even see you. They only change direction if you touch them.
"the precision of the numbers will be a little less" There are no precise numbers involved in this.
Report Abuse
HotThoth is not online. HotThoth
Forum Moderator
Joined: 24 Aug 2010
Total Posts: 1176
30 Apr 2012 07:10 PM
If it's not .DesiredAngle = , is it a LocalScript? Hmmm... try making it a normal (server-side) Script, and see if that fixes the problem [see my post on the other "humanoid issues" thread].
Report Abuse
1waffle1 is online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
30 Apr 2012 07:17 PM
It's a script inside a Model in Workspace that clones creatures onto the planet and has them walk around.

    local planet = script.Parent
    local c = script.Parent.Creature
    local creature = c:clone()
    c:remove()
    
    while wait(1) do
        if #planet:GetChildren()-2 < 20 then
            local c = creature:clone()
            c.Parent = planet
            c.Humanoid.MaxHealth = math.random(100, 500)
            c.Humanoid.Health = c.Humanoid.MaxHealth
            c:MoveTo(planet.Floor.Position + Vector3.new(math.random(-100, 100), math.random(10, 20), math.random(-100, 100)))
            c:MakeJoints()
            
            Delay(0, function()
                c.Torso.Reflectance = c.Humanoid.MaxHealth/500
                c.Humanoid.Died:connect(function()
                    wait(6)
                    c:Destroy()
                end)
                local p = Instance.new("Part", c)
                p.Anchored = true
                p.Transparency = 1
                p.FormFactor = "Custom"
                p.Size = Vector3.new(0,0,0)
                local move = function()
                    if c:findFirstChild("Torso") then
                        p.Position = c.Torso.Position + CFrame.Angles(0,math.random(0,1000),0).lookVector*1000
                        c.Humanoid:MoveTo(p.Position, p)
                    end
                end
                for _, v in ipairs(c:GetChildren()) do
                    if v:IsA("BasePart") then
                        v.Touched:connect(function()
                            move()
                        end)
                    end
                end
                while c do
                    if not c:findFirstChild("Torso") then
                        c:Destroy()
                        break
                    end
                    move()
                    wait(5)
                end
            end)
        end
    end

That's all it does.
Report Abuse
1waffle1 is online. 1waffle1
Joined: 16 Oct 2007
Total Posts: 16381
30 Apr 2012 08:03 PM
HotThoth, was that you just there as Games in my game?
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