A type of programming, often meant to be easier to learn than more "traditional" programming. Scripting is often used when performance is less important than ease of use. Examples of scripting languages are: Javascript, Lua, Perl, Python, and PHP. Scripting languages are often interpreted instead of ...
0
votes
2answers
41 views
How can I change my script execution order programmatically?
I have a script that I want to run before any other script. I want to change its execution order settings. I could do that using the Script Execution Order Settings option from within Unity, but I ...
-1
votes
1answer
61 views
Increment int in array - int i is out of scope? [on hold]
This is my scenario:
I have a 3D model of a house, and an autonomously moving robot moving through the house picking up multiple objects. I have an array of 3 objects I want it to pick up, but I ...
0
votes
1answer
29 views
Moving autonomous robot form one location to another based on array
I have a 3D model of a house, and I want an autonomous robot to move from 1 object in this house to the next one. I have it moving to the first, but it won't move to the second one. This is my code:
...
0
votes
2answers
34 views
Autonomous robot - moving from 1 object to the next object
This question falls in line with my last question: Unity 3D - create autonomous moving robot in house + first person camera movement
What I have
I have a 3D model of a house; a first-person camera ...
0
votes
1answer
20 views
How to get which gameobject the mouse is over in Unity?
So I'm working on a simple drag-n-drop based trading card game for my own amusement.
There is a card inspector included.
What I want to achieve is to change values in the inspector (which has its ...
0
votes
1answer
50 views
Unity 3D - create autonomous moving robot in house + first person camera movement
I have very, very little knowledge about programming or Unity. I have done some basic tutorials, but I want to try something harder. The thing is, I don't know where to start. If you find the time to ...
0
votes
1answer
41 views
Unity 5/C#/Scripting Switching Cameras
How can I switch cameras from First Person to Third person or from thrid person to first person. Like at GTA V you can switch the cameras. How to do this?
Tnx for your time.
0
votes
2answers
45 views
How can I get the assignment of an object back?
I have been struggling with this NullReferenceExpection error.
When I don't add anything and just use this version of the code. The game adds a tower, upgrades a tower and takes money for it.
It ...
1
vote
1answer
75 views
iOS build size is too large in Unity
I have finally completed my game and ready to upload my game to the App store, but my build size is too large.
I have checked log statement and it is roughly 13.3 mb but when i build my game and test ...
-3
votes
2answers
77 views
Is it possible to use Java as a scripting language in unity? [duplicate]
I wonder if its possible to use Java as a scripting language in unity to create a basic 2d game?
0
votes
1answer
55 views
Call a BlueprintImplementableEvent from c++ in unreal editor?
I created a custom actor:
BPTest.h:
#include "GameFramework/Actor.h"
#include "BPTest.generated.h"
UCLASS(Blueprintable, BlueprintType)
class ABPTest : public AActor
{
GENERATED_BODY()
public: ...
2
votes
1answer
73 views
How to send an interface message?
I come from Unreal, still using it. There, how it works is like this:
Let's say you as a player have a laser gun or something, and when shooting, you use raycast to see if you've shot anything, and ...
0
votes
1answer
29 views
Do Game-Maker scripts save the variables or are they deleted after excecution?
When i make a script that excecutes at the beggining and has a var ammo and that finishes excecution, will i be able to call the var ammo in other scripts or it will be deleted? If it will not be ...
0
votes
0answers
20 views
How to change text on collision in Unreal Engine
I've just started using Unreal Engine, and I was trying to do a super simple game where there is a character that has text above his head that says 'Bag 'o' fries'. My plan was to have it so if ...
0
votes
1answer
96 views
Orion Leap Motion`Hand' does not exist in the type `Leap.Leap' - Compile error for core assets
I was playing with the example scenes provided by the Core Assets pack. Everything was working perfectly in Unity 5.3.2f1 until I opened the PinchingSandbox scene and added two script components to ...
0
votes
0answers
16 views
Move car with script [duplicate]
How would I go about writing a car script in C#. Is there anything special I would need to code. Or is it simply if pressed certain button, Rigidbody.AddForce() or transform.Translate().
My question ...
0
votes
1answer
79 views
Unity3D: 'Physics' does not contain a definition for 'Raycast'
I'm a complete beginner in Unity 3D, and I'm following a video training. In the video the instructor uses the following code to open a door using raycast:
using UnityEngine;
using System.Collections;
...
6
votes
0answers
114 views
Design patterns for live coding/script reloading [closed]
I would like to make C++/Lua combo and write scripts for a game with live script reloading. What design patterns should I be aware of so not to cause me unnecessary pain?
For example if I have a ...
1
vote
1answer
48 views
saving script state
I'd like to ask you, since most of you have some or a lot of experience in writing games. What is your approach to running scripts and saving game state when script is executing when there is a chance ...
0
votes
0answers
24 views
Add script to created gameobject via script
GameObject.AddComponent
Hi, I have this c# code. It is creating random cubes and spheres. I have a script named "destroy". I want to add this "destroy" script to below code. I gave new material but ...
1
vote
1answer
76 views
Unable to move mouse cursor while pressing keyboard button
I've a player to which I've attached character controller and two scripts - Controller and MouseLooker to control the player movements but when I try to move my mouse cursor while pressing keyboard ...
0
votes
1answer
39 views
Why this if logic isnot short circuiting?
I've this script in UNITY to check if the hit RayCastHid2D variable has some gameobject with hole tag or a parent gameobject with hole tag when I Raycast...
if (hit.collider != null && ...
0
votes
0answers
155 views
Blueprint For Switching Between Cameras In The Unreal Engine
So basically I have a scene in the Unreal Engine which has multiple cameras within it, the cameras are intentionally static as the application should behave more like a viewing gallery than a game. As ...
5
votes
2answers
568 views
Can you write the current frame number to a text file?
I am running an experiment in Unity 5 to see the effect increasing the particles of a particle effect has on FPS over time. (this is background work for a much larger piece of work). Currently I write ...
1
vote
1answer
58 views
Resource management with Lua integration
I have a questions about how to better implement resource management when integrating with Lua. I have an entity system that has gameplay logic done in Lua. One of the design points was that I wanted ...
2
votes
2answers
112 views
“Binding” script functions to C++ functions
I appreciate the answer to this question might be a little too broad for SE, but hopefully someone can point me in the right direction.
I'm developing a small scripting language for use in my game ...
2
votes
1answer
67 views
Sound and Unity 5
I want to work on sound in games, but I don't have any experience in scripting, only in sound design for film. Some friends that do know scripting are starting to learn in Unity 5, and my part would ...
1
vote
1answer
99 views
Multiple lua scripts using newthread
I'm trying to hook lua-scripts to my entities, where several entities of the same type want to use a separate instance of the same script. Problem is, when I run two or more scripts and use any C-api ...
1
vote
0answers
56 views
Collision issue [closed]
I have a player who i control with tilting. Also i have some game objects (something like ground or areas where player can not move). The problem is that if these objects are too small the player can ...
3
votes
0answers
48 views
Free scripting in Construct 2?
In Construct 2 example about creating an animated player, they used more than 8 events:
4 events to store movement direction into Direction variable from Player.8Direction.MovingAngle
4 events to ...
0
votes
0answers
96 views
Firing particle systems on prefab objects
In my game, I Instaniate several of the same prefabs for a group of player controlled characters. The prefab contains child objects with particle systems attached. For example one of the particle ...
1
vote
0answers
30 views
Scripting Language for Java and its uses? [duplicate]
So I am going to work on a Java game and recently my friend suggested I use a scripting language to help development go smoother/faster.
so far I used XML as data storage and to make the HUD/UI but ...
6
votes
3answers
194 views
Which parts of game should belong to engine and which should belong to scripts?
Often, the game is splitted into engine code (i.e. C++) and scripts (i.e. Lua).
The question is which parts / modules of game code should typically belong to engine, and wchich should belong ...
1
vote
1answer
252 views
How to Slice the external Spritesheet programmatically by using C# in Unity
I have a sprite sheet like this:
I am using Unity Engine to develope my game. I would like to load this external spritesheet outside and slice it as Grid type programmatically instead of using ...
0
votes
2answers
179 views
Unity - Determine direction vector3 from a point in space and an angle in eulers
I have a ball positioned as Vector3(x, x, x).
I was able to get the direction of the ball to the mouse clicked position with:
Code (csharp):
Vector3 direction = Direction (clickPos2 - startPos);
...
1
vote
1answer
84 views
Player launches into air when hitting steep slopes
I've been debugging an issue where when my player is moving forward at high speeds (I have configurable movement modes for an overview/overwatch mode) if they are in walk mode and hit a steep slope ...
0
votes
2answers
90 views
Player in Spaceship
I want to realize space game on Unity3d engine. There are some huge spaceships in the void. So, I want players flying in space in weightlessness, but when they go inside any spaceship, they will be ...
1
vote
1answer
107 views
Unity 5.x - Editor only constructor/initilization event
I have three scripts:
Level - Represents a Tile Based level.
LevelEditor - Custom Editor for Level.
Tile - A non monobehaviour class for storing tile information.
Level contains an array of Tiles ...
17
votes
4answers
3k views
What can I do to avoid one-off flags and checks throughout my code?
Consider a card game, such as Hearthstone.
There are hundreds of cards that do a wide variety of things, some of which are unique even to a single card! For instance, there is a card (called ...
4
votes
3answers
159 views
Scripting: to block or not to block
Context: I'm making a little "program your robot army" sort of game in Java in which the player writes Lua scripts (which are then run by LuaJ) to program their robots to do stuff. So far there are ...
0
votes
0answers
95 views
How would I go about creating my own SDK to allow users to develop their own addon mods?
I am looking into developing a game, but I am very interested in the more abstract concepts such as modding. I would like to know, or get linked to information detailing the prerequisites, ...
0
votes
3answers
1k views
Calling and functions/methods from different Classes in Unity
I am learning some of the basics with Unity and am running into calling/sending code to a different script.
For example, the code below is a basic menu of options. I have a different Scene set up in ...
0
votes
1answer
89 views
Kinematic equations script fail
I added the kinematic equations to my code and now none of it works. I get the error rigidbody.torque assign attempt for 'Enemy' is not valid. Input torque is { 0.000000, NaN, 0.000000 }.
...
0
votes
1answer
97 views
Audio slider doesn't change value
For some reason, my slider and audio resets back to 0 when I stop and play the game after I changed the value. Here is the code, I can't spot anything wrong with it:
using UnityEngine;
using ...
1
vote
1answer
233 views
How do I use playerprefs to make ui slider keep the sound settings?
I have not use playerprefs before, I want to know how to keep the change of the audio when the player change it throughout the game.
0
votes
1answer
37 views
Error BCE0043,BCE0044 and UCE001 [closed]
I got my code right here:
#pragma strict
var hSliderValue : float = 0.0;
function OnGUI(){
hSliderValue = GUI.HorizontalSlider (Rect (25, 25, 100, 30),hSliderValue, 00, 1.0);
...
-1
votes
1answer
89 views
How is the relationship between Scripts and Objects in Unity?
If I don't attach the Script to the Object, will be the code able to "see" the object?
When I need to manipulate (such as enabled() or a transform()) two or more Objects, do I need to attach the ...
0
votes
1answer
58 views
Unity gravity not effecting everyone like it should
so My problem is a bit weird. I have a model that will not fall at the correct speed. She falls incredibly slowly. This is the only script attached to her, and I did the "Scale to large" test by ...
4
votes
3answers
216 views
Single Switch Script vs Multiple Scripts
Would it be better to have one script that switches or have multiple scripts with each with their own function?
In example, Lets say I am making a powerup script.
Option 1: Create a single powerup ...
2
votes
1answer
62 views
Unable to achieve two finger panning
I'm looking to achieve a two finger smooth pan system in my project.
However, the code below does not work, any interaction with the screen doesn't change to position of the camera.
I am unsure where ...