I am creating a 2d Android Sandbox RPG game, I just wanted to know how could I create a script which makes 2d platforms. Like a 2d character can stand on a 2d “block”?
Are you using sprites?
Or by 2D do you mean side view camera in a 3d scene?
I can’t buy sprites so I was talking about side view of camera to make a 3d cube look 2d by the angle
There are some good scripts in the 2d platform tutorial, or creating your own is pretty easy too.
I use the trigger and parent method for platforms. If your not familiar with it, the way it’s done is place a trigger on the platform a little above the platform top surface. Then when entering make the player a parent of the platform with a little player upward transform movement. And then on Trigger Exit unparent the player.
I learned the method of You tube.
I am doing something similar. If you are doing a 2d perspective rendered in 3d you just deal with x,y and z will always be constant. Don’t let the fact that it’s 3d throw you off. If you are using a rigid body then you want to apply constraints to it so it wont fall off the ‘front’ (close to camera) or ‘back’(away from camera). I’d post some samples and screens but I am actually in the middle of finishing it as a commercial game for iOS ![]()
I am doing something similar(not rpg just 2d . If you are doing a 2d perspective rendered in 3d you just deal with x,y and z will always be constant. Don’t let the fact that it’s 3d throw you off. If you are using a rigid body then you want to apply constraints to it so it wont fall off the ‘front’ (close to camera) or ‘back’(away from camera). I’d post some samples and screens but I am actually in the middle of finishing it as a commercial game for iOS ![]()
I’d have a look at the platforming tutorial. It does what I think you are looking for.
How could I do that sorry I am still new to scripting!!! and thanks!!! ![]()
If you want to come out like a pro then spend a week doing all the tutorials. Collect the scripts because they are designed to lat down the basics. There is even a standard platform script that is part of the first person camera character motor. I personally had trouble with that though so i wouldn’t recommend it. One thing that bugs me is the CharacterMotor stuff is spread across three scripts, and even though it’s very advanced it’s not very easy to understand cause it’s all jumbled up. First thing i did was put all of it on one script and chopped half of it without taking away the features lol.
If you cant find the vid ill lay down some examples for ya.
You can force a player to stay on the z position you want by just updating it;s pos (ie) transform.position.z = 0;
Use Spriteworks
SpriteWorks is a flexible application that takes 3D models in Collada and .DTS format and turns them into 2D sprite textures. This can be used to produce very realistic sprites from well lit and normal mapped 3D models. You can also select any animation sequence attached to a DTS shape to create an animated sprite sheet.
SpriteWorks features complete camera control so you can get the camera angle you want. It also has an auto-aiming feature that always points the camera to the model, regardless of the camera’s position. You can also pick from a list of preset camera positions or define your own for quick and consistent rendering. The whole goal is to balance flexibility with ease of use. If you’re planning an isometric game, or any 2D game that would benefit from some 3D graphics, this might be useful.
SpriteWorks is produces images that are translucent .png files that will work with any 2D graphics engine. In the video below, SpriteWorks is used to take a 3D robot DTS model, select an animation (in this case “run”), generate the animated sprite sheet, then import it into Torque X Builder 2D. SpriteWorks will work with just about any DTS file, from Kork the sample player to the many buildings and vehicles sold as content packs.