Categories
Game Creation Mastering Development

Unity: Sprite stretch issue

I have a simple png square 8px x 8px. In Unity I’ve left the pixels per unit at 100 and added the image to the scene to create a prefab of the item. I then add four items to the screen like so: var block = Resources.Load("Prefabs/Block", typeof(GameObject)); Instantiate(block, new Vector3(1f, 0f), Quaternion.identity); Instantiate(block, new […]

Categories
Game Creation Mastering Development

Unity3D – Despite using Time.deltaTime, my camera and player move faster at higher framerates

I’m pretty new to c# and Unity so I wouldn’t be surprised if I had made some stupid mistakes, but as far as I know, I don’t think I misused Time.deltaTime. Any help would be greatly appreciated. Movement Script: using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerMovement : MonoBehaviour { public CharacterController controller; public […]

Categories
Game Creation Mastering Development

How to extrude mesh?

Say we have the following simple mesh data: // additional data // Vector3(x, y, z) – +x left, +y up, +z forward // triangle indices are in clocwise order // list of vertices that form a place List<Vector3> vertices = new List<Vector3>() { new Vector3(2f, 0f, 2f), new Vector3(-2f, 0f, 2f), new Vector3(2f, 0f, -2f), […]

Categories
Mastering Development

Unity2D – How to move and rotate particle system around a circle?

I’m trying to instantiate a rain particle system to follow a circular path. The clouds rotate and move around a circular planet perfectly fine. The problem arises when the particle system is instantiated, it almost never has the correct rotation, no matter where it is spawned. I tried making the particles a child of the […]

Categories
Development Game Creation

How do I initialise levels sequentially?

I have been learning opengl and I have made good progress over past few months. However I still struggle to understand game logic in C++, I am new to C++ too. Say I have this program. #include <headers> int main() { #Step 1 VAO_VBO_EBO_inits(); while(!glfwWindowShouldClose(window)) { glClearColor(.2f, .2f, .3f, 1.f); glClear(GL_COLOR_BUFFER_BIT); #Step 2 DrawCalss(); glfwPollEvents(); […]

Categories
Development Game Creation

What is Unity Quaternion range?

I’ve read somewhere that a Quaternion in Unity ranges between [-1,1] values. I mean the individual XYZW values. Ex: new Quaternion(.1f,.2f,-.3f,-.4f) Is this true? More clearly: I know they take float values therefore the theoretical limit is floating point value limitations, I’m asking the real rotation results. For instance when I look up Quaternion values […]

Categories
Development

Code Error. The modifier public is not valid. Why?

I am making a 2D game in Unity and am trying to make my moveable character stop every time dialogue appears on screen. I am using the Fungus extension for my dialogue as I’m a newbie to coding. Every thing I try however I run in to problems. My current issue is that the modifier […]

Categories
Development

String to ASCII Hex splitting in C

I am using C in Labwindows CVI 8.5. I need to convert the float to ASCII Hex: #include <stdio.h> #include <string.h> int main () { char K_char[20], K_ASCII[20]; int a = 30; //30 degree Celsius int i, len ; float k = a + 273.15; //Temperature Celsius to Kelvin sprintf(K_char, “%.2f”, k); //Temperature K convert […]

Categories
Development

An incomprehensible error appears at startup

Sorry for my English. I’m beginner in OpenglES. I wrote this code to draw simple table for airhockey. The code was taken from book OpenglES2 for Android and i’m a bit to modified it. When i launched my app, it’s crashed. Wherein do not appear an errors. The code from ShaderHandler.java public class ShaderHandler { […]

Categories
Development

OpenGL ES3 displays blank screen, but compiles fine

I can’t seem to get my vertex data to display on my GLSurfaceView, but everything renders fine. I am familiar with basic OpenGL but I am new to OpenGL ES 2/3 and GLSL, so I figure I am missing something obvious. I have refactored my app a number of times to resolve context and syntax […]