Hodo33 Posted December 5, 2019 Share Posted December 5, 2019 My player needs rest so I provided a bed. Interact with bed, you get mounted in sitting pose and pops a dialog to get up.When you click the get up button it calls this:function serverCmdDoneBed(%client){ %client.player.bedrep = 0; %client.player.unmount(); %bed = %client.player.bed; %client.player.bed = 0; %spawn = "bedSpawn"@%bed; %client.player.setTransform(%spawn.getTransform()); %client.player.isMounted = false;}I have a player spawn point called bedspawn1,2,3 etc all is well at this point.If the player sits on the bed again and gets up, they fall through the floor. Can be repeated and the spawn point is way above the floor.I have this same issue with a vehicle if I get in then out then in and back out I fall through the land.It's almost like the engine loses track of position or collision is lagging a update or it's not cleared. Been looking in the engine but can't see where it happens.anyone encounter this issue ? Quote Link to comment Share on other sites More sharing options...
Duion Posted December 7, 2019 Share Posted December 7, 2019 Why do you respawn the player out of the bed anyway? Is it not enough to just change the mount and animation?For spawning you should always spawn things above to where you want them spawned, so you have a little buffer zone that prevents glitching through the floor, if you already have that the problem may be somewhere else.Also it may depend on the physics engine you use, I had problems with PhysX and Bullet before. For example one issue was that when I fire my weapon and run forward, the player somehow managed to run faster than the bullet and the bullet would hit him, causing damage to yourself.But I can just guess here, a video or so would probably help much, to me it just sounds you are doing things too complicated. I mean if you really want to respawn the player near the bed, then you can manually place a spawn that works I don't see the problem there. Maybe the animation messes up the collision box and that is why you glitch through. Quote Link to comment Share on other sites More sharing options...
Bloodknight Posted December 7, 2019 Share Posted December 7, 2019 When you say 'way above the floor' could you quantify that? also, you should be able to just set an actual position and teleport the player without a spawn point, as long as you have a small clearance above the floor object. Is the effect occurring *during* the animation at a particular spot? or before or after? Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted December 9, 2019 Author Share Posted December 9, 2019 Using basic physics. As I said it works once but if I mount back to the bed without moving and get up again player falls through. I am using a spawnsphere with one meter size. the bottom point of the hedron is like 0.1 m above the floor. If I just do a unmount the player is standing in the middle of the bed so I needed to move him away.How do I post a direct image here? I.E. no url Quote Link to comment Share on other sites More sharing options...
Duion Posted December 9, 2019 Share Posted December 9, 2019 Uh do you use the default spawn function where it spawns you in a random location inside the spawn sphere? Either change the function or much easier just change the spawn sphere size to something very small, so there is less variation. The polyhedron is just a model to symbolize the spawn sphere, the green sphere is what defines where the player spawns.I have not thought about the problem of the player standing in the middle of the bed, if you just unmount. Can't think of a good solution right out of my head now for that, maybe one thing, did you know you can make animations offset from the models origin? So you can make an animation where the player goes to bed, without actually changing the players location. At least I think that's possible. Similar to the death animation where the player falls over, but the models origin is still where his feet were before he fell, so you can make a go to bed animation similar like that. Quote Link to comment Share on other sites More sharing options...
Bloodknight Posted December 9, 2019 Share Posted December 9, 2019 you could post as an attachment, but there are good sites for images, Imgur and vgy.me Imgur allows anon uploads, vgy.me needs an account but its free and you can set up albums, also as a bonus both of these sites integrate with sharex https://getsharex.com/ Quote Link to comment Share on other sites More sharing options...
TorqueFan Posted December 9, 2019 Share Posted December 9, 2019 Just from memory, I recall the engine does a lot of things along the lines of...obj->disableCollision();… do stuff....obj->enableCollision();...when certain checks are made. IIRC, you can look at the collision code in 'Item' to see an example of this. I remember trying to get some immediate updates on collision before, and what ultimately nailed it down for me was calling updateWorkingCollisionSet() on the Player object. I believe I even went so far as to make an EngineMethod out of it and calling it from script when I had to. Quote Link to comment Share on other sites More sharing options...
Hodo33 Posted December 10, 2019 Author Share Posted December 10, 2019 @TorqueFan you had the magic answer. I did the same and made a engineMethod and call it just before setting the transform and it works perfect.. thanks mucho !!! Quote Link to comment Share on other sites More sharing options...
TorqueFan Posted December 12, 2019 Share Posted December 12, 2019 You're welcome! Glad to see you got it working! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.