Hi everyone, I realise these may be very simple questions for most of you but I can’t work out how to do them.
By the way, I’m completely new to unity and game programming so please excuse my ignorance.
I have recently started to work on my first game, and even though I haven’t done anything like this before I got most of it up and running in one night, but there are two things puzzling me.
1)I have an object I want to use as a cannon that will shoot spheres. This cannon can only rotate around the y axis. Obviously I want the sphere to be emitted in whatever direction the cannon is pointing when the player presses fire.
I’m not asking for scripts or complete answers, but if someone could point me in the right direction such as which classes to use or the general theory behind how this is normally done, I would be grateful.
- How do I read the current state of an object? I want to right a script for one object that depends on the current y position of another object. How do I get the y value of this other object into my script?
Also I’m using javascript in case that matters.
Thanks for your help, and thanks to the guys who coded the unity engine, I never thought I’d stand a chance at making my own game-It’s good to be proven wrong!