Hi
I try to integrate some script in another, both in the same project and get:
Error CS0246: The type or namespace name ‘Ocean’ could not be found (are you missing a using directive or an assembly reference?) (CS0246) (Assembly-CSharp-firstpass)
Ocean.cs is in the project. What do I need to change for my first scripting attempt?
Thanks
Most likely it is not related to Linux. But I am still trying to help you to resolve that initial issue. That’s why it would be extremely useful if you could answer my questions.
Unity has several compilation steps for the scripts, depending on the folders in which the scripts are placed.
That’s why it is important to know in which folder the scripts are.
Well I didn’t change anything. I only disabled buoyanc script and pasted most into mouse look. Both are parented by player. Unfortunately I’ve erased this and loaded a new script that I did last week. Now this seems ok so maybe you need
a new script while changing deps? I might try again but not sure if I can redo the very same.
Now for debugging the new script how to set the current debugger position visible. It debugs but I cannot see at what
line the debugger currently is. (cs monodevelop on Windows)
Thanks
f: \ UnityprojWin \ Surfs_High2a \ Assets \ Standard Assets \ Character Controllers \ Sources \ Scripts \ MouseLook.cs (2,2): error CS0246: The type or namespace name “Ocean” could not be found. (Missing a using directive or an assembly reference?) (CS0246) (Assembly-CSharp-first pass)
/// MouseLook rotates the transform based on the mouse delta.
/// Minimum and Maximum values can be used to constrain the possible rotation
/// To make an FPS style character:
/// - Create a capsule.
/// - Add the MouseLook script to the capsule.
/// → Set the mouse look to use LookX. (You want to only turn character but not tilt it)
/// - Add FPSInputController script to the capsule
/// → A CharacterMotor and a CharacterController component will be automatically added.
/// - Create a camera. Make the camera a child of the capsule. Reset it’s transform.
/// - Add a MouseLook script to the camera.
/// → Set the mouse look to use LookY. (You want the camera to tilt up and down like a head. The character already turns.)
public class AddBuoyancy : MonoBehaviour
{
Ocean m_ocean;
still the same as above. I only pasted from the other script as said multiple times.
This is the MouseLook script? First the class and file name have to match. If the class name is MouseLook, the script name has to be MouseLook.cs, if it is a C# script.
Besides that, you still didn’t answer in which folder those scripts are. I don’t care about how it is setup in the game object right now. What matters is the place where the script is stored, like Assets/Scripts/Ocean.cs.
You should either create a new thread or check the existing ones if it is a different topic. Just in the case you are using Linux, make sure to mention it.