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: Any way of doing this w/o crashing physics?

Previous Thread :: Next Thread 
b1tmap is not online. b1tmap
Joined: 03 Jan 2011
Total Posts: 425
19 Oct 2015 10:10 PM
while true do
main.BodyVelocity.velocity = main.CFrame.lookVector * speed
wait()
end

All I'm doing is moving a part forward based on its lookVector, in a server based on FE. No RemoteEvents or RemoteFunctions are being fired. No idea why, but this specific part of code basically wreaks havoc on the physics. However, I tested out some free models that use the same method, and they work fine. Why?

By "crashing" I mean the part ("main") just spazzes out in one place, teleports to somewhere, then teleports back.
Report Abuse
b1tmap is not online. b1tmap
Joined: 03 Jan 2011
Total Posts: 425
19 Oct 2015 10:15 PM
pls?
Report Abuse
FlyNormal is not online. FlyNormal
Joined: 30 Sep 2015
Total Posts: 344
19 Oct 2015 10:20 PM
I believe you don't need to use while loop for BodyVelocity.

Just set it once and it will move accordingly without stopping.
Report Abuse
dearjournal is not online. dearjournal
Joined: 04 Nov 2012
Total Posts: 2289
19 Oct 2015 10:22 PM
1. are you sure that line is what's causing that behavior?

2. sanity check 'speed'

3. I reproduced this setup and it works fine for me so it's probably something else causing it.
Report Abuse
b1tmap is not online. b1tmap
Joined: 03 Jan 2011
Total Posts: 425
19 Oct 2015 10:23 PM
A while loop is one of the ways to update it, but setting it once doesn't work. It would just fly along the initial lookVector.
Report Abuse
dearjournal is not online. dearjournal
Joined: 04 Nov 2012
Total Posts: 2289
19 Oct 2015 10:23 PM
"Just set it once and it will move accordingly without stopping."

A possibility is that he might want it to constantly move forward its look vector, even if it changes orientation.

a while loop is not the best solution for this though you're right.
Report Abuse
b1tmap is not online. b1tmap
Joined: 03 Jan 2011
Total Posts: 425
19 Oct 2015 10:27 PM
Well, thank you at least for testing that stuff out for me. I was too lazy :p

Now I just have to sift through 5 long scripts to see wtf causes this

funfun
Report Abuse
b1tmap is not online. b1tmap
Joined: 03 Jan 2011
Total Posts: 425
19 Oct 2015 10:36 PM
Actually, yeah, I think it's that line. If I comment it out, sure, the ship doesn't move anywhere, but the lag isn't present either.
Report Abuse
dearjournal is not online. dearjournal
Joined: 04 Nov 2012
Total Posts: 2289
19 Oct 2015 10:39 PM
Well it's probably a combination of that line+something else, cuz when I just have those lines it works as expected for me.

It's hard to tell what it might be without knowing what else is going on but good luck!
Report Abuse
lego555444 is not online. lego555444
Joined: 21 Sep 2008
Total Posts: 1383
19 Oct 2015 10:45 PM
while wait() do
main.BodyVelocity.velocity = main.CFrame.lookVector * speed
end

put it in its own script and experiment with the other BodyVelocity properties
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