[Unity] Resolution for an error when using Unity Ads.

I used “Unity Ads” for Advertisement of my released mobile game apps. It’s very easy to put Advertisement for our game apps. Yes, it’s easy, but sometimes following error happen, then I took long time to resolve it. [Error Message] error CS0433: The imported type ‘UnityEngine.Advertisements.ShowResult’ is defined multiple times   [Reason] This error will be happen, if you turn ON for Unity Ads function in Service tab of Unity... Read more

[Unity] Physics: I tried “Physics. Spherecast”.

Before, I tried “Physics.Raycast”, then I wrote the results in this blog. [Link: Physics: I tried “Physics.Raycast” from Game Object.] [Link: Physics: I tried “Physics.Raycast” from Camera.] This time, I’ll introduce other Casting methods under Physics class. (However, I think that “Raycast” is the most popular and used high frequently.) [Ref: https://docs.unity3d.com/ScriptReference/Physics.html]   [Some Cast methods under Physics class] BoxCast Casting Box shaped Ray, check whether hit the ray to... Read more

[Unity] I tried to draw to Texture. Part2

Last time, I tried to directly draw to a texture attached game object. [ Previous: I tried to draw to Texture. Part1 ] In the blog log, looks like many people are reading the source, so this time I’m explaining more about the logic for beginners. Following is the C# source for drawing a texture, I added many comments so that you can understand easily this source. This ‘Paint_Line’ method... Read more

[Unity] I tried to draw to Texture. Part1

This time, I tried to directly draw to a texture attached a game object. This program is very simple. To test drawing to a texture, it’s drawing yellow color at the position where the game object is locating on the red texture which is attached on a field’s game object. [To realize this function] There are 2 game objects and 2 C# programs for this test. ‘Test_Draw’ is a program... Read more

[Unity] Physics: I tried “Physics.Raycast” from Camera.

Last time, I tried Raycast by casting Ray from a game object. [Link: Physics: I tried “Physics.Raycast” from Game Object.] This time, I tried another way of Raycast. That is casting Ray from Camera. [Ref: https://docs.unity3d.com/Manual/CameraRays.html]   [Test image to cast Ray from Camera] When clicking a game object which are scattered in 3D space by mouse, the shape and color (object name and tag) are shown.   [Source code... Read more

[Unity] Physics: I tried “Physics.Raycast” from Game Object.

You know, we normally use “Raycast” to identify Game Objects existed in certain direction from one location. The image is like that you emit virtual laser beam from a certain position, then if the beam hit somethings, you’ll get the information of the objects. 2 ways for Raycast The method of this, there are 2 ways like following Cast a Ray from a Game Object To identify the objects which... Read more

[Unity] uGUI: I tried each “Render Mode” of Canvas component.

To create UI, it’s normal to use uGUI which is standard functions of Unity now. UI objects which are put in a scene are rendered by Canvas object. So it’s necessary to use Canvas when you use any UI objects. This time, I tried and compared 3 Render Modes of Canvas component. (Ref: https://docs.unity3d.com/Manual/class-Canvas.html ) 3 Render Modes of Canvas Canvas have 3 Render Modes listed following. Screen Space –... Read more

[Unity] Script: I tried to move game objects by “Transform”.

Last time, I tried to move game objects by “Rigidbody“. (URL: http://blog-e.lab7sg.com/archives/84) This time, I tried basic ways to move game objects by “Transform“. [To specify the location to move in the flame] 1. position: Specify the position in a world space. 2. localPosition: Specify relative position from parent object (If it doesn’t have the parent, it’s same as ‘position’.) 3. Translate: Move to specified direction and distance. (Ref: https://docs.unity3d.com/ScriptReference/Transform.html)... Read more

[Unity] Script: I tried to move game objects by “Rigidbody”.

To move game object in Unity, there are some ways. The one is to use ‘Rigidbody’. And also exist some ways for the ‘Rigidbody’. This time, I tried following 4 ways. [To specify the location to move in the flame] 1. position: completely teleportation 2. MovePosition: moving almost instantaneously (possible to interpolate in the intermediate position) [Add power or velocity to the object] 3. velocity: change the velocity in that... Read more