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: Making a Swimming fish.

Previous Thread :: Next Thread 
puppyboy803 is not online. puppyboy803
Joined: 28 Nov 2008
Total Posts: 1458
19 Dec 2015 04:01 PM
Hello, I successfully made it so my fishes fins and tail moves. The only thing I have left to do is to make it so the entire fish moves. The issue is my fish is a model, not a solo brick. I however did make a script that moves a mesh of a fish to various locations, but it teleports the fish, the fish doesn't move smoothly.

Fish = script.Parent

while wait(2) do -- Infinite loop!

Fish.CFrame = CFrame.new(math.random (1,100),math.random (1,5),math.random (1,100))

end

How can I make my model of a fish move to various locations like the script above, but make it move smoothly and not teleport? The script below I think is very wrong.

local children = workspace.Fish:GetChildren()


while wait(3) do -- Infinite loop!
for i = 1, #children do
children.CFrame = CFrame.new(math.random (1,100),math.random (1,5),math.random (1,100))

end
end
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
19 Dec 2015 04:13 PM
You're just repeatedly repositioning the fish's children to random positions. In code theory, did you even think this made sense? You need to give the fish a start position and then loop through by adding an incremental value to the fish's position and make it go further. You may want to raycast some checks too for turning to make sure it doesn't just go through walls. You can also add some randomization by multiplying the incremental CFrame value with a random angle to also add to it. Make sure to keep the value relatively small so it doesn't spin randomly for no reason.
Report Abuse
Aethex is not online. Aethex
Joined: 16 Oct 2011
Total Posts: 2193
19 Dec 2015 04:14 PM
By the way: You can either set the PrimaryPart of your fish model and use that, or you can weld the fish to one object inside of the model. That way the fish will move together and not all over the place.
Report Abuse
fishguy100 is not online. fishguy100
Joined: 16 Feb 2013
Total Posts: 3679
19 Dec 2015 04:31 PM
WHY CHU COPY ME
Report Abuse
triode is not online. triode
Joined: 13 Aug 2011
Total Posts: 5844
19 Dec 2015 04:43 PM
As much as I'd like to help, I would be giving away my fish animation. I am working on a game that will be tycoon/Real life based.

Well two games, yee
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