Basic movement
First operational deplacement made for our players.
We began like that.
After corrections, we achieved:
Now, the next challenge is synchronize animations with deplacement smoothly.
The code of the script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test_Deplacem2 : MonoBehaviour
{
public float _Fl_Speed;//, _Fl_Gravity, _Fl_Max_Vel_Change;
private Transform _Trans_Player;
private Rigidbody _RB_Player;
public Transform _Trans_LookAt;
// Start is called before the first frame update
void Start()
{
_Trans_Player = GetComponent<Transform>();
_RB_Player = GetComponent<Rigidbody>();
}
// Update is called once per frame
void FixedUpdate()
{
LookAt();
MoveTo();
}
void LookAt()
{
Vector3 _V3_Look=new Vector3(-Input.GetAxis("Vertical"), 0, Input.GetAxis("Horizontal"));
_Trans_Player.LookAt(_Trans_LookAt.position+_V3_Look);
}
void MoveTo()
{
Vector3 _V3_MovVelocity = new Vector3(-Input.GetAxis("Vertical"), 0, Input.GetAxis("Horizontal"))*_Fl_Speed;
//_V3_MovVelocity = _Trans_Player.TransformDirection(_V3_MovVelocity);
_V3_MovVelocity *= 10;
_RB_Player.AddForce(_V3_MovVelocity);
}
}
Also we share the RigidBody config:
Insect Vs Vikings
Action - Puzzle 2 vS 2 cooperative competitive game
Status | Released |
Authors | ImagInkArt by Ricardo Rodríguez V, D4WR1N |
Genre | Action, Puzzle |
Tags | Multiplayer |
More posts
- Characters integrationApr 06, 2020
- Integration advanceApr 06, 2020
- the horseman completedApr 06, 2020
- 4 horseman of the apocalypseMar 10, 2020
- final scenario prototype and UI overlay testMar 10, 2020
- Spoiler insect.Mar 03, 2020
- Tryng maps and color palettesMar 03, 2020
- Sculpted Characters.Mar 03, 2020
- Testing materialsMar 03, 2020
Leave a comment
Log in with itch.io to leave a comment.