Relative Content

Tag Archive for c#unity-game-engineunityscript

Why Raycast hit did not assign limits from my script when I raycast a gameobject

I make a Door logic for my game using RaycastHit from mouse left button to open the door (or assign the Hinge Joint limits which are declared as float types in the class), but the problem is that I can raycast the Door Gameobject but the script didn’t assign the limits for hinge on raycasted object. The scene Hinge component is setup correctly on the Door Gameobject I use for raycasting and also I use layermask to filler raycast gameobjects.

Unity 3d queueing NPC

How is it better to create a script for controlling NPC behavior in case of Queue like a queue to Cash Desk? I am trying to create a finite-state machine inside NPC script, that would be there for each NPC, but recently I heard that it is also possible with Singleton.

Why is the player not moving with a moving platform in unity?

If I am running the game in build mode, and when I jump onto the platform, the player moves along with it. But whenever the player dies and goes inactive, resets position and goes active again, it then doesn’t work. Weirdly enough, when I am in the attacking mode, it works, but when I am in the regular moving mode, it doesn’t.

looking for better function in my pong game

I recently start learning unity and for my first game i choose pong and well the game is playable but have a logical problem with ball and it is when it hit the sidewalls it doesn’t matter the angle of hit,it always come back with same 45 degree angle for example when ball hit with 2 degree it return in 45 and ruin game and predictable
this is the function
any help?