- Home /
Question by
Shadowlash1221 · Dec 31, 2015 at 09:43 AM ·
c#rotationshooting
Why is my projectile's rotation sideways?
I'm trying to fire my laser projectile but it's rotation is sideways when i shoot it, i changed the rotation in blender but that did no better, it was still sideways! If there is something i have to do to my model or script please tell me. Thanks!
using UnityEngine;
using System.Collections;
public class Shooting : MonoBehaviour
{
public Rigidbody projectile;
public float speed = 20;
// Update is called once per frame
void Update ()
{
if (Input.GetButtonDown("Fire1"))
{
Rigidbody instantiatedProjectile = Instantiate(projectile,transform.position,transform.rotation)as Rigidbody;
instantiatedProjectile.velocity = transform.forward * speed;
instantiatedProjectile.transform.forward = transform.forward;
}
}
}
Comment
Your answer
Follow this Question
Related Questions
Flip over an object (smooth transition) 3 Answers
Cinemachine camera rotating with player 2D 1 Answer
Distribute terrain in zones 3 Answers
[C#]Angle of shooting equale to mouse direction 1 Answer
Multiple Cars not working 1 Answer