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: I need help scripting a moving platform

Previous Thread :: Next Thread 
Robloxian25537811 is not online. Robloxian25537811
Joined: 31 Dec 2011
Total Posts: 4227
25 Sep 2014 06:38 PM
I am making a 2D platformer, and what better thing that to make a platformer with... well platforms? The 2D platformer can only move with the X and Y axises from the spawn point as if the Z axis didn't exist in movement, which is no big deal here.

I am trying to create a moving platform which moves on the X axis (the left and right) that the character can ride on (which means the character cannot slip off of it) to get to one point to another, like a typical moving platform in classic side scrollers like Mario, Megaman, and Sonic.

I was digging through moving brick scripts in Free models, which I use for scripting ideas and research, since I don't have heavy knowledge in creating a script. However after trying to copy and paste a script and the values from the brick to the brick I want to move, it just doesn't work. It works with the other part however.

I tried looking into the script to see if it only works with a certain part name, but I found nothing. It just is unwilling to work after copying and pasting it.

Here is the script in question, made by iBlocker:


time = 3
bp = script.Parent.Position
while true do
script.Parent.BodyPosition.position = Vector3.new(bp.x-20, bp.y, bp.z)
wait(time)
script.Parent.BodyPosition.position = Vector3.new(bp.x, bp.y, bp.z)
wait(time)
end

I don't see anything in here that would not make it work from moving it into another part. I also made sure I copied the BodyGyros and the BodyPositions with the exact same values as before. What am I doing wrong here?
Report Abuse
Robloxian25537811 is not online. Robloxian25537811
Joined: 31 Dec 2011
Total Posts: 4227
25 Sep 2014 06:42 PM
Also to clarify, I can't just use the existing brick in question because I am a SelectionBox for the block I want to use, and SelectionBoxes cannot be copy and pasted without breaking it, so I have to move it into the block with the SelectionBox
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