Sign in to follow this  
churchill

onClientClick with pickups?

Recommended Posts

onClientClick is supposed to return an element that was clicked on. the element can supposedly be any physical entity (such as Player, Vehicle, Object, Pickup, Marker, Blip, Radar Area), and yet if I click on a pickup, I get false. Clicking on myself gives me "player", so it must be working?

Whereas if I use createObject instead of createPickup, I can click on the object and it returns "object", which is correct, but the downside is that it seemed to render the object equivalent smaller than the pickup equivalent! :(

in my test I was using the dollar sign (1274)

Share this post


Link to post
onClientClick is supposed to return an element that was clicked on. the element can supposedly be any physical entity (such as Player, Vehicle, Object, Pickup, Marker, Blip, Radar Area), and yet if I click on a pickup, I get false. Clicking on myself gives me "player", so it must be working?

Whereas if I use createObject instead of createPickup, I can click on the object and it returns "object", which is correct, but the downside is that it seemed to render the object equivalent smaller than the pickup equivalent! :(

in my test I was using the dollar sign (1274)

Might be because it isn't solid?

Share this post


Link to post

Yeah, I've noticed the same thing previously. The reason basically is that a pickup is just an object loaded, sized, and collisions turned off and a colsphere added on it. Any object that has collisions disabled won't register any kind of click. My solution was to do my own custom "pickups" and whenever the cursor is enabled, collisions are enabled... it kind of sucks though because then the player could theoretically crash their car into the object, etc. (Oh, and the collisions will be the size of the actual object, not the resized pickup's size.) On a funny note, if one of these pickups is in the middle of the road, and you have your cursor enabled, then when someone else drives by it looks like they crash their car and they go flying, but then suddenly they are back to driving normally down the road (the other players all just see the car driving by normally though.)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.