- Home /
Question by
Mido_unity100 · May 25, 2017 at 02:57 PM ·
c#2dunity5
dash till puff game
hey ... i am trying to make dash till puff game just for training .. but i have a problem ..
in the game when i touch the screen i can move up when i release it i can move down ...
i feel no forces when i play it
all i did just it can jump when i press "W" key in that code below ......
using UnityEngine;
using System.Collections;
public class player_control : MonoBehaviour {
Rigidbody2D rb2d;
public float speed = 1.0f;
// Use this for initialization
void Start () {
rb2d = gameObject.GetComponent<Rigidbody2D>();
}
// Update is called once per frame
void Update () {
if(Input.GetKey("w")){
rb2d.velocity = (new Vector2 (0, speed));
}
}
}
i don't want that .... it should fly not jump
and here is all physics i added to the ball

so any ideas ??
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Spikes for a platformer game 1 Answer
enable and disable loop objects in the scene 1 Answer
How can i make a sprite move in the direction it is rotated? 1 Answer