Monday, 4 July 2011

Update for Week 12

For today, i did some tweaks on the robot model i made. I also UV unwrapped the model for texturing and I did a basic script for the movement of the character, which i still need to tweak.





This is the model i've worked on so far. Modelling isn't really my strong point so.......it's not a highly detailed model, but for our project I think its sufficient enough.

Here's a screen shot of the UV unwrap i did :



I then started to work on a character movement script in Unity. I made a test scene with a long terrain and the camera placed to look at it like a side scroller. I just used a capsule object as a dummy character. Both the character and terrain had rigid bodies placed on them, the character also had gravity enabled.




I did a basic script for the movement. Initially i just parented the camera under the character model, but Mr Ron suggested to have the camera move only when the player reaches the end of the screen, i'll have to find out how to script that.


I used this script for the movement:

void Update ()
    {
        // this get input for left/right and adds to player speed and time
        float horMov = Input.GetAxis("Horizontal") * playerSpeed * Time.deltaTime;

        // this get input for up/down and adds to player speed and time
        float verMov = Input.GetAxis("Vertical") * playerSpeed * Time.deltaTime;

        this.transform.position = new Vector3(transform.position.x + horMov,
                                     transform.position.y + verMov,
                                     transform.position.z);

No comments:

Post a Comment