Quantcast
Channel: Questions in topic: "error message"
Viewing all articles
Browse latest Browse all 2891

Hi im getting this error in my script Assets/MouseManager.cs(11,27): error CS1525: Unexpected symbol `Vector3'

$
0
0
using UnityEngine; using System.Collections; public class MouseManager : MonoBehaviour { void Update() { if( Input.GetMouseButtonDown (0) // We clicked, but on what? Vector3 mouseWorldPos3D = Camera.main.ScreenToWorldPoint(Input.mousePosition); Vector2 mousePos2D = new Vector2(Input.mouseWorldPos3D.x, Input.mouseWorldPos3D.y); Vector2 dir = Vector2.zero; RaycastHit2D hit = Physics2D.Raycast (mousePos2D, dir); if(hit != null && hit.collider!=null) { // We clicked on SOMETHING that has a collider if(hit.collider.rigidbody2D !=null) { hit.collider.rigidbody2D.gravityScale = 1; } } } }

Viewing all articles
Browse latest Browse all 2891

Trending Articles



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