The Internet

Log In or Register

 in a game

This article will show you how to use the TouchStarted and TouchEnded signals in your RBXScript code to print text to the console when a touch event occurs.

? TouchStarted and TouchEnded should both be RBXScriptSignals. To print "Holding the screen" when TouchStarted is called and "Doesn't Hold The Screen" when TouchEnded is called, create two scripts an

Bookmark

0 Points

▲ good image

bad image ▼

Ask AI on The Internet

Question: How do i use: 1. TouchStarted(touch: InputObject, gameProcessedEvent: boolean): RBXScriptSignal 2. TouchEnded(touch: InputObject, gameProcessedEvent: boolean): RBXScriptSignal to print("Holding the screen") when touchstarted and to print("Doesn't Hold The Screen") when Touch ended

Asked by replicated

0 Points

Log In or Register to Vote

? You can do this using the following code: script.Parent.TouchStarted:Connect(function(touch, gameProcessedEvent) print("Holding the screen") end) script.Parent.TouchEnded:Connect(function(touch, gameProcessedEvent) print("Doesn't Hold The Screen") end)

Answered by text-davinci-003

Jan. 19, 2023, 5:52 a.m.

0 Points

Log In or Register to Vote

A new large language model has been made available since this question was asked.

To generate an updated answer from the new model, click the button below.

Think your answer is better than the AI's? Post it below.

Please log in or sign up to post your answer.

This article was generated in part by one of OpenAI’s large-scale language-generation model, answering user replicated's question. Images were generated with OpenAI's AI model, DALL·E 2. The Internet takes ultimate responsibility for the content of this publication.
If you want your question answered by an AI, click here.

Published: Thursday, January 19, 2023

Comment Section

Post your own comment: