Why is the GUI frame not showing up when I trigger the proximity prompt on Roblox? - roblox

Why is the GUI not showing up when I fire the client? I'm not very good at Roblox scripting.
Local Script:
game.ReplicatedStorage.Events.OpenLoadout.OnClientEvent:Connect(function(player)
game.StarterGui.GunShop.MainFrame.Visible = true
game.Workspace.LoadoutShop.Prompt.Enabled = false
print("Test")
end)
Server Script:
prompt = script.Parent.Prompt
prompt.Triggered:Connect(function(player)
game.ReplicatedStorage.Events.OpenLoadout:FireClient(player)
end)

There are a few possible reasons why the GUI frame is not appearing when the proximity prompt is triggered on Roblox:
The GUI frame may be set to invisible in the Roblox settings. To check if this is the case, go to the Roblox settings menu and make sure that the "GUI Frame" setting is set to "Visible".
The GUI frame may be hidden behind another frame. To check if this is the case, try moving the other frame out of the way or changing the z-order of the frames.
The GUI frame may be off-screen. To check if this is the case, try moving the camera so that the frame is visible on-screen.

Called wrong game user interface
You have used game.StarterGui.GunShop.MainFrame.Visible = true which sets the starter gui frame to visible, not the player one.
To fix this, simply change this line to player.PlayerGui.GunShop.MainFrame.Visible.

Related

Remove ui square when many touches

I am coding a game on a Touchscreen with many players at the same time. The issue is, when there are 2 or more touches, a little square is appearing on the screen. It seems to be a unity built-in feature as it is still present in an empty project.
Is there a way to prevent this annoying little square to appear ? I already disabled magic touch shortcuts in windows. And this doesn't appear on the desktop home screen.
I am able to listen to the touches. It seems to be only a visual thing.
Even when I disable multitouch with Input.multiTouchEnabled = false; It still appears.
I also tried to remove the 18 default Axes in the Input Manager.
My goal is to handle every touch separately, without listening to pinch, long press, or scroll interactions. Each player has only to tap somewhere on the screen.
Thanks for you time
Solved it by myself. I completely disabled Touch feedback in the windows parameters. I don't think it is the only way to do that but it works.
Configuration Panel > Pen and Touch
Unmark "Show visual feedback when touching the screen"

Unity UI screen size issue

I'm quite new to Unity, so I'm sorry if this is a basic question. I've been trying to set up the UI for a mobile game, but I'm not quite sure how to make the UI lock it's position, no matter the screen size. I've tried using anchors (though I don't fully understand how to use them properly), I've tried using a canvas scaler, I've looked at the Unity document and I just can't seem to find an answer. The buttons are off screen/half off the screen when I build the game to my device/switch screen sizes in the game view. Does anyone know how to fix this?
You can set your anchor point by selecting the UI object (such as a button) and then clicking here and selecting the right anchor point. You can also press down shift to set the pivot and/or alt to move the object to that point at the same time. The object should now be anchored to that point and keep its position even if the resolution is changed. You can set a precise position from the inspector, too. Simply adjust the Pos X and Pos Y variables. It will still adhere to the anchor point.
Note that you might have to play around with the Canvas object's UI Scale mode and its settings to get the right setup.

UI Hololens - HandDraggable Issues

I've recently created a 2D app for the HoloLens. It is a UI Panel with several buttons into it. In order to drag the panel and be positioned as the user wants, I implemented the HanDdraggable.cs functionality (from HoloToolKit). However, whenever I try to move the panel it also rotates.
To change that I modified the Rotation Mode from "Default" to "Orient Towards User" and "Orient Towards User and Keep Uptight". But then It works even worst; if I implement that case, whenever I try to select the panel and drag it to somewhere, the panel runs off from my field of view and it suddenly disappears.
I wanted to ask if somebody has already tried to implement the HandDraggable option into an UI Hololens app and knows how to fix this nodding issue.
I'm currently working on hololens UI for one of my projects and to manipulate UI I used TwoHandManipulatable script which is built into MixedRealityToolKit. In Manipulation Mode of that script you could only set "Move" as an option, and this would allow you to move a menu with two hands, as well as one. (I wanted to have a menu which you can also rotate and scale - which works perfectly with this script, you can lock around which axis you want to have rotation enabled, to avoid unwanted manipulation).
For your script HandDraggable, did you try to set RotationMode to Lock Object Rotation? Sounds like this could solve the problem.

Dealing with Popup in Corona game engine

I have a screen in Corona to display a puzzle, and once user guess the correct answer, I'm going to display a simple pop up on the screen to do the congratulation a long with close button to dismiss the popup, now I need for a simple work around to disable any control or behaviour on the original screen while displaying the popup, how can I do that?
I think you need to do this by stop or pause transitions, timers and animations etc. before you go to scene with pop up.
You can add transparent rectangle from transparent image file (not just rectangle, as it will not be touchable).
Size of this rectangle must be the size of all screen.
Position of rectangle - under your popup (or better make it as part of your popup).
Add listeners to this rectangle on touch and tap that will just return false - so it will prevent any clicks under it.
That will save you from pausing / disabling buttons, that you don't want to disable/pause.

How to make an animation clip on Unity to loop

I am using the Unity Mecanim, and I have two animation clips:
The problem is that when the animation of a clip finish it doesnt start again from the beggining, it doesnt loop, and I cannot find any option to make it loop.
Any help, where to look for the loop options?
EDIT:
I find the options according to the answers here but there are not editable, is it because I download this from Asset Store?
Its probably too late to help you with this, but just incase anyone else has this issue, your looping options are greyed out because your animation from the asset store is read-only, select your animation in the project window, and press Ctrl+D to duplicate it, and you should be able to now set the looping options on the new animation as the other answerers have described.
Click on your Run_Impulse animation file and there is an option:
http://docs.unity3d.com/Documentation/Components/class-AnimationClip.html
Loop Pose option should be cheked for make it loop
Here, there is more information about making loop an animation clip:
http://docs.unity3d.com/Documentation/Manual/LoopingAnimationClips.html
EDIT: I add an image. You have to select your imported FBX (not the animation file inside) and check the Loop Time.
http://answers.unity3d.com/questions/204331/animation-loop.html
Go to the animation and set it as looping .In the Animation window look at the bottom for something that should say 'Default' - it's a drop-down menu with looping options (Loop starts the animation over, PingPong plays it back and forth, Clamp Forever freezes the animation at the state of the last frame etc.)