Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

Script spawned peds not showing in interiors


Grady Featherstone
 Share

Recommended Posts

Grady Featherstone

Hey everyone!

 

 

I haven't really used the forums that much, so I apologise if this isn't the correct place to post this... but,

I'm having a bit of a problem here...

What I'm doing is spawning a normal Ped inside an interior ("Lucky Winkles" pub, it's in Algonquin sorta near the pay 'n' spray near The Triangle). Now sometimes when you go in there, there'll be a guy waiting to play darts with you, and someone working behind the bar, which says peds can function in there, but when I spawn a ped using

 

 

Ped packie;packie = World.CreatePed("IG_PACKIE_MC", new Vector3(-431.03f, 452.71f, 10.40f));

 

 

It works (it's C#), and he's in the right spot, except on some angles he's invisible, and as I walk and move the camera around the area he will become visible for a split second, and then disappear again. One strange thing I noticed is, if I kill him, and then drive around the block and come back, I can see the body laying on the ground and it stays visible... Also, straight after I spawn him, if I go outside, I can see him through the windows all the time...

I've noticed there are some problems with spawning objects/pickups and peds in interiors, but I spawned a ped in the same interior with the Simple Native trainer and I could see that ped fine, so my issue is at the point when I spawn it, but if the ped dies, then I can see him fine... strange....

Does anyone know what's going on and how I can fix this?

 

Thanks a lot!!!! smile.gif

-Grady

 

[EDIT]

I just tried spawning him next to me outside of the pub, and then pushing him in through the door, and he seems to be appearing normally... This is definitely very strange...

Edited by Grady Featherstone
Link to comment
Share on other sites

do this when niko is indoor

packie.CurrentRoom = Game.LocalPlayer.Character.CurrentRoom;

 

 

yeah i guess outdoors is one room and indoors is another, so when u were outside u could see them because they were in your room ;D

Edited by ch3y3zze
Link to comment
Share on other sites

Grady Featherstone

That worked if I spawned him while I was in the interior, but if I was outside, and then went in, same problem, and I guess that makes sense as if I'm outside your setting the ped's world to "outside" so when I go in he doesn't appear properly.... Is there a way for it to work if I'm outside when he's spawned? I realised that if I spawn him outside and then set his position (basically teleport) him inside, then if I'm outside or inside it will work fine, but that's extra code which is a pain.....

Link to comment
Share on other sites

That worked if I spawned him while I was in the interior, but if I was outside, and then went in, same problem, and I guess that makes sense as if I'm outside your setting the ped's world to "outside" so when I go in he doesn't appear properly.... Is there a way for it to work if I'm outside when he's spawned? I realised that if I spawn him outside and then set his position (basically teleport) him inside, then if I'm outside or inside it will work fine, but that's extra code which is a pain.....

use a tick method and check for distance for ped and when close enough set his room maybe, yeah the point is to figure out to set his room when ur in the same room, u have to setup the logic but yeah that's how u can see him if u spawn while outside his room. Maybe u can say which room he is in but havent looked into it.

Link to comment
Share on other sites

Grady Featherstone

Yeah thanks! I think I know a way I can incorporate that!!! Also, if I set his room to the interior, but then bring him out, will I be able to see him outside even if I don't reset his current room to a non-interior?

Link to comment
Share on other sites

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
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.