Quantcast
Channel: Questions in topic: "ragdoll"
Viewing all articles
Browse latest Browse all 565

Make a car drive only when a ragdoll is indside.

$
0
0
So I am making a racing game where you control a ragdoll in a car and i have a movement script, but i'm quite new to unity and im not sure how to make it so you can only control the car while the ragdoll is inside. If it helps I am using C# and here is the movement script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { private float speed = 10.0f; private float turnSpeed = 25.0f; private float horizontalInput; private float forwardInput; // Update is called once per frame void Update() { horizontalInput = Input.GetAxis("Horizontal"); forwardInput = Input.GetAxis("Vertical"); transform.Translate(Vector3.forward * Time.deltaTime * speed * forwardInput); transform.Rotate(Vector3.up, turnSpeed * horizontalInput * Time.deltaTime); } }

Viewing all articles
Browse latest Browse all 565

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>