View Single Post
LithuanianJack
Senior Member
Join Date: Nov 2013
Location: Vilnius, Lithuania
Old 11-16-2018 , 12:10   Re: Problem with "register_touch"
Reply With Quote #10

Quote:
Originally Posted by Kushfield View Post
It gets printed only in the center because thats how big you have set the entity size (entity_set_size( iEntity, Float:{ -1.0, -1.0, -1.0 }, Float:{ 1.0, 1.0, 36.0 } ); )
This means the entity size is 1 unit in each direction from the center (except upwards, which is 36)

If you want to print the text just once, you need to create some variable that stores if players have already got the message or not, then check and set that variable's value in the touch callback. Touch gets called on every frame where the object is touched.
Thanks for your explanation, but I can’t do this because I’m beginner. Can you write simple code? I need an example to learn
LithuanianJack is offline