|
| 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 |
|
|
| 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 |
|